A few Swift functions for converting Jalaali (Jalali, Persian, Khayyami, Khorshidi, Shamsi) and Gregorian calendar systems to each other.
Jalali calendar is a solar calendar that was used in Persia, variants of which today are still in use in Iran as well as Afghanistan. Read more on Wikipedia or see Calendar Converter.
Calendar conversion is based on the algorithm provided by Kazimierz M. Borkowski and has a very good performance.
Use Carthage to build and install.
func toJalaali(gy: GregorianYear, _ gm: GregorianMonth, _ gd: GregorianDay) -> JalaaliDate
func toGregorian(jy: JalaaliYear, _ jm: JalaaliMonth, _ jd: JalaaliDay) -> GregorianDate
func isValidJalaaliDate(jy: JalaaliYear, _ jm: JalaaliMonth, _ jd: JalaaliDay) -> Bool
func isLeapJalaaliYear(jy: JalaaliYear) -> Bool {
func lastDayOfJalaaliMonth(jy: JalaaliYear, _ jm: JalaaliMonth) -> JalaaliDay
typealias JalaaliDate = (year: JalaaliYear, month: JalaaliMonth, day: JalaaliDay)
typealias GregorianDate = (year: GregorianYear, month: GregorianMonth, day: GregorianDay)
typealias JalaaliYear = Int
typealias JalaaliMonth = Int
typealias JalaaliDay = Int
typealias GregorianYear = Int
typealias GregorianMonth = Int
typealias GregorianDay = Int
typealias JulianDayNumber = Int
MIT