mudasobwa

mudasobwa

Creator of Cure

`Tempus`, the library to handle time slots

Tempus has become more than just plain time slot management. The best example would be managing a schedule for the dentist (check if the slot is available, or joint, or when the next available slot of the given duration is available, etc.)

It allows one to manage time slots effortlessly. The mathematical background of the implementation reveals that under the hood it has an Enumerable which implements a protocol. Two default implementations backed by List and Stream are included.

Adding a slot to an instance of Tempus.Slots automagically merges it if applicable. List implementation (which is the most suitable for short slot series) might be merged into the Stream implementation.

From the outmost world, the usage is as easy as Tempus.free?(slots, origin) or like. Slots obviously implement Collectable protocol and other goodness.


This version comes with a lot of guards that might be used when dealing with datetimes, not only slots.

Comments and criticism are highly appreciated. We have used this library in production to handle weekends/holidays in different countries (which are declared as an infinite stream) for a couple of years already.

Most Liked

mudasobwa

mudasobwa

Creator of Cure

Effective today, Tempus supports different calendars.

It’s still very much WIP and there are tweaks and quirks required in config to make it work with a different calendar (because is_coming_before/2 is essentially a macro which is allowed in guards,) but I have tested it and I can claim it’s fully functional even with datetimes given in different calendars, let alone different timezones.

Enjoy.

Where Next?

Popular in Announcing Top

seancribbs
Today I released a new dialyzer Mix task as the dialyzex package! At the time we started writing this task, the existing dialyzer integra...
New
ityonemo
Currently just starting out on a new mini-project - getting zig NIFs to run in elixir. https://github.com/ityonemo/zigler The idea here...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 13736 119
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12560 134
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps w...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

We're in Beta

About us Mission Statement