dc0d
Implementing a Calendar
I have implemented functions for converting dates between Persian and Gregorian calendars (algorithm by Kazimierz M. Borkowski). Is there a sample on how should I implement a full calendar?
Marked As Solved
wojtekmach
Hello, you basically need to implement the Calendar behaviour. There’s a similar project called jalaali and the calendar implementation is here: elixir-jalaali/lib/jalaali/calendar.ex at main · jalaali/elixir-jalaali · GitHub. There’s also a simple calendar used by Elixir tests here: https://github.com/elixir-lang/elixir/blob/master/lib/elixir/test/elixir/fixtures/calendar/holocene.exs.
Also Liked
Qqwy
And the Calendar documentation might also help you with properly implementing this.
And don’t be scared to look in the source code of the built-in Calendar.ISO calendar implementation, it is very readable
!









