{"repo":"jalaali/go-jalaali","free":true,"listed":false,"github":"https://github.com/jalaali/go-jalaali","clone":"git clone https://github.com/jalaali/go-jalaali.git","description":"Go implementation for converting Jalaali and Gregorian calendar systems to each other.","language":"Go","stars":62,"topics":["go","golang","jalali","persian","calendar"],"license":"MIT","category":"productivity","readme_excerpt":"Jalaali Golang implementation of Jalaali JS and Jalaali Python implementations of Jalaali (Jalali, Persian, Khayyami, Khorshidi, Shamsi) convertion to Gregorian calendar system and vice-versa. This implementation is based on an algorithm by Kazimierz M. Borkowski. Borkowski claims that this algorithm works correctly for 3000 years! Documentation on API is available here at Go official documentation site. Installation Use go get on this repository: Usage Current time Jalaali.Now() returns a Jalaali instance wrapping the current time. You can use all the methods from the Go time package on it. From a time instance Jalaali.From(t) wraps an existing time.Time instance. You can then work with it the same way you work with the time package. Converting dates Convert a Gregorian date to Jalaali with ToJalaali , and back with ToGregorian . Both return the date components plus an error that is non-nil when the input is invalid. Formatting Call the JFormat method of a Jalaali instance and pass it the same formatting layout used by the Go time package. The output is a Jalaali date using Persian digits and words. Utilities - IsValidDate(jy, jm, jd) returns true if the given Jalaali date is valid. - IsLeapYear(jy) returns true if the given Jalaali year is a leap year. - MonthLength(jy, jm) returns the number of days in the given Jalaali month.","default_branch":null,"files":null,"tree":[],"storefront":"/r/jalaali","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jalaali/go-jalaali/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}