alisinabh
Jalaali (Shamsi) calendar for elixir (Persian calendar)
Hey everyone
i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice versa.
Jalaali is also known as Persian calendar or Shamsi calendar and is widely used in Persia and Afghanistan.
its available in hex with name of :jalaali
its pretty easy to use
iex> jalaali_dat = Jalaali.to_jalaali(DateTime.utc_now)
and…
iex> Jalaali.to_gregorian(jalaali_date)
hope you guys enjoy using it (if you ever need
) ,
Thanks
Most Liked
josevalim
Thank you for the package!
Btw, Elixir calendar types supports custom calendars. By default we use Calendar.ISO but there is a field on every struct called :calendar which you could store your custom calendar and it would be invoked when appropriate by Elixir.
I would love to know if you tried implementing the Jalaali on top of Elixir date types. I will be glad to answer any question you may have about the process or fix any bug you spot.
alisinabh
Hey Jose
First of all i wanted to thank you for creating elixir and maintaining it. You are really active and passionate about it.
I just began learning elixir in about 20 days and i am absolutely in love with it and its community, where every one is trying to do their best to keep it perfect.
Unfortunately i did not know that i can change :calendar in Date for localization. shame on me i’m a bit lazy with reading docs! ![]()
But i will fix that and make it to work as a Calendar.
I will let you know about the process and if i got to anything i couldn’t solve i will ask for your help
Thank you for your support you just made me get more and more excited about Elixir. ![]()
P.S: Did i forgot to say that “YOU ARE AWESOME”?
alisinabh
Jalaali 0.2.0 is Released!
Hi everyone.
The new version of Jalaali is released supporting Elixir Calendar system announced in Elixir 1.5
In the new system Dates/DateTimes can be converted easily thanks to @qqwy and @josevalim
You can easily type DateTime.utc_now(Jalaali.Calendar) in order to get current DateTime in any calendar (in this example Jalaali)
Or you can use Date.convert or DateTime.convert functions to convert any Date/DateTime to any calendar implemented in Elixir.
For more information on how to use this new features you can either read Jalaali docs github.com/jalaali/elixir-jalaali or Elixir calendar docs.
Please report any issues you encounter while using Jalaali.
Thanks
Popular in Announcing
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
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









