mudasobwa

mudasobwa

Creator of Cure

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.

Showing Posts 1 to 3

mudasobwa

mudasobwa OP

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.

mudasobwa

mudasobwa OP

Creator of Cure

I finally got to 1.0.0-rc.0 with Tempus introducing open/close slots.

Here is the comparison against Tempo, a brilliant library by @kip (spoiler: libs are not rivals.)

mudasobwa

mudasobwa OP

Creator of Cure

TempusSQL has been also upgraded to 1.0.0-rc.0

Heavily inspired by ex_money_sql, it shifts the slot comparison operations to the database, exporting started_after/2 and a scaffold to build custom retrieval functions.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews