ravi11o

ravi11o

Datex is a user friendly simple date and time library which I build while learning elixir and phoenix. It deals with standard date and time formats along with elixir formats. It has functions for comparing, adding and formatting dates and time from standard formats to elixir and vice-versa. It provides super friendly comparison results like 3 days ago or 2 months later in date and like an hour ago in time. It even has functions which provides a date-list in desired format from a dateRange.

I know its not perfect but I have tried my best and I am open to suggestions and feedbacks.

Thanks!

Showing Posts 1 to 2

Eiji

Eiji

@ravi11o Did you know about timex? I did not looked deep into your library, but it’s what comes to me while reading your description. In such cases community would like to know why did you created such library (like solve problem in different way than current implementation does) and how different it’s from other implementations (for example compare it to already mentioned by me timex). It would be helpful if in your post you will add this information.

ravi11o

ravi11o OP

@Eiji I am aware of timex and in no way it could stand among Timex or any such date time library like calendar.
As I have already mentioned I created it while learning and thought of maybe it could help some in the community. I had no intention of flooding the forum.

Anyways, as far as I know Timex functions deal with Erlang datetime tuples, Date, NaiveDateTime, and DateTime. Datex is simply for date and time and it has no support for datetime or naive yet. Here you don’t have to worry about formats like dd-mm-yyyy or yyyy/mm/dd as you can parse any date format. For example..

> Datex.Date.format_date("2017/2/10", "MONTH_NAME_FULL DATE YYYY") 
"February 10, 2017"

OR

> Datex.Date.format_date(~D[2019-02-10], "DAY_SHORT, DATE MONTH_NAME_SHORT")
"Sun, 10 Feb"

I have also tried relative date and time comparison inspired from momentjs. Again you don’t have to worry about formats. For example..

> Datex.Date.compare("15 aug 2018", ~D[2018-08-06])
"a week and 2 days later"

> Datex.Time.compare(~T[23:16:45], "15:34:25")
"7 hours and 42 minutes later"

It also supports a lot of different formats to work with on date and time.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
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
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
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
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
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
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews