Package-level declarations

Types

Link copied to clipboard
data class PersianDate(val year: Int, val month: Int, val day: Int)

A date in the Persian (Solar Hijri, Jalali) calendar, the civil calendar of Iran and Afghanistan. month is 1 (Farvardin) .. 12 (Esfand); months 1-6 have 31 days, 7-11 have 30 and Esfand has 29, or 30 in a leap year. Supported years: -61..3177 AP.

Link copied to clipboard
class PersianDayInfoProvider(strings: PersianStrings = PersianStrings.English) : DayInfoProvider

DayInfoProvider that labels each day with its Persian (Jalali) date: the month name on the first day of a month, the day number otherwise. DayInfo.payload is the PersianDate, DayInfo.tags is ["persian"] and DayInfo.priority is DayInfoPriority.SECONDARY. Dates outside the supported years -61..3177 AP return null.

Link copied to clipboard
class PersianStrings(val monthNames: List<String>, val digits: String = "0123456789")

Labels used by PersianDayInfoProvider: monthNames holds the 12 month names from Farvardin, shown on the first day of each month; digits holds the ten digits 0..9 used for the other days' numbers.

Functions

Link copied to clipboard

Whether Esfand of this date's year has 30 days.

Link copied to clipboard

Number of days in this date's month.

Link copied to clipboard
fun PersianDate.toLocalDate(): LocalDate

Converts this Persian date to a Gregorian LocalDate.

Link copied to clipboard
fun LocalDate.toPersianDate(): PersianDate

Converts this date to the Persian calendar.