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
!
Last Post!
dc0d
Just reinvented the wheel! Jalaali package is using the same algorithm! Should have mention it inside docs somewhere though.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









