alisinabh

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 :smile:) ,
Thanks

Most Liked

josevalim

josevalim

Creator of Elixir

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

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! :disappointed_relieved:

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. :blue_heart:

P.S: Did i forgot to say that “YOU ARE AWESOME”?

alisinabh

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

Where Next?

Popular in Announcing Top

ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19417 141
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12645 134
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31013 112
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement