mudasobwa
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.
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mudasobwa
Effective today,
Tempussupports different calendars.It’s still very much WIP and there are tweaks and quirks required in
configto make it work with a different calendar (becauseis_coming_before/2is 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
I finally got to
1.0.0-rc.0withTempusintroducing open/close slots.Here is the comparison against
Tempo, a brilliant library by @kip (spoiler: libs are not rivals.)mudasobwa
TempusSQLhas been also upgraded to1.0.0-rc.0Heavily 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.