Can I add the Dekatrian Calendar?

103 views
Skip to first unread message

Luis Sousa

unread,
Jan 9, 2022, 9:40:17 PM1/9/22
to elixir-lang-core
I want to add implements the Dekatrian calendar for elixir, I want to know if I can do it and how is the steps to do this.

w...@resilia.nl

unread,
Jan 11, 2022, 7:47:12 AM1/11/22
to elixir-lang-core
Hi there!

This is most definitely possible. You can do so in its own library, as Elixir's builtin date/time/calendar handling functionality is built in such a way that it is easily extendable for future calendars without changing the language itself.

It is recommended reading the documentation in the Calendar and the various date/time modules. It might also be worthwhile to look into how they are implemented by looking at their source.
As for examples of other calendars: Besides Calendar.ISO which ships with Elixir itself, there are a couple in ex_cldr_calendars and libraries dependent on that as well.

Cheers,

~Marten/Qqwy

Luis Sousa

unread,
Jan 11, 2022, 4:48:29 PM1/11/22
to elixir-lang-core
Thank you for your explanation, it helped me.

I think that calendar modules may stay in core, so, with a external libary its possible to use the date and dateTime just pass my module as one of the arguments right?!

Thanks for your attention,
Luis Sousa

Kip

unread,
Jan 21, 2022, 5:47:01 PM1/21/22
to elixir-lang-core
That's quite a simple calendar (other than Acrônian and Synchronion) so I suggest look at the Calendar behaviour and then the very simple holocene calendar that is used in Elixir tests.  I've built quite a few Elixir calendars to happy to help.
Reply all
Reply to author
Forward
0 new messages