Package-level declarations

Immutable calendar models (CustomCalendar, SimpleDate, SimpleTime, NepaliMonthCalendar), locale (NepaliDateLocale), digit scripts, and the NepaliDateFormatter contract that drives locale-aware rendering.

CalendarSystem is the named form of the era integer (1 = AD, 2 = BS) and MonthCalendar is the calendar-tagged counterpart of NepaliMonthCalendar, so month geometry can be handled without knowing which calendar produced it. Use toMonthCalendar and toNepaliMonthCalendar to move between the two.

Types

Link copied to clipboard

The calendar a date is expressed in.

Link copied to clipboard
data class CustomCalendar(val year: Int, val month: Int, val dayOfMonth: Int, val era: Int, val firstDayOfMonth: Int, val lastDayOfMonth: Int, val totalDaysInMonth: Int, val dayOfWeekInMonth: Int = -1, val dayOfWeek: Int = -1, val dayOfYear: Int = -1, val weekOfMonth: Int = -1, val weekOfYear: Int = -1)

Represents a date in a custom calendar system with detailed information.

Link copied to clipboard
data class CustomDateTime(val customCalendar: CustomCalendar, val simpleTime: SimpleTime)

A data holder representing a CustomCalendar and SimpleTime.

Link copied to clipboard

Numeral script used when rendering digits in localized dates / times.

Link copied to clipboard
data class MonthCalendar(val calendarSystem: CalendarSystem, val year: Int, val month: Int, val totalDaysInMonth: Int, val firstDayOfMonth: Int, val lastDayOfMonth: Int)

The geometry of one month in a given CalendarSystem: enough to lay out a weekday grid without knowing which calendar it came from.

Link copied to clipboard

Represents the format for displaying names (e.g., weekdays or months).

Link copied to clipboard

Represents different styles for formatting Nepali dates.

Link copied to clipboard

Parse and format SimpleDate for short numeric text-field input.

Link copied to clipboard
data class NepaliDateLocale(val language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH, val dateFormat: NepaliDateFormatStyle = NepaliDateFormatStyle.LONG, val weekDayName: NameFormat = NameFormat.FULL, val monthName: NameFormat = NameFormat.FULL, val digitScript: DigitScript? = null)

Represents locale settings for Nepali date display and formatting.

Link copied to clipboard

Represents the language used for Nepali date pickers.

Link copied to clipboard
data class NepaliEnglishMonthDay(val englishDayOfMonth: Int, val nepaliCalendar: CustomCalendar?)

One day of a Gregorian month beside the Bikram Sambat calendar it converts to, which is absent for a day the conversion table does not reach.

Link copied to clipboard
data class NepaliMonthCalendar(val year: Int, val month: Int, val totalDaysInMonth: Int, val firstDayOfMonth: Int, val lastDayOfMonth: Int, val daysFromStartOfWeekToFirstOfMonth: Int = firstDayOfMonth - 1)

Represents a calendar month in the Nepali calendar system.

Link copied to clipboard
data class NepaliMonthName(val short: String, val full: String)

Represents the name of a month in the Nepali calendar.

Link copied to clipboard

Parse and format SimpleTime as the library's canonical time-of-day wire string, HH:mm:ss with an optional nine-digit fractional part.

Link copied to clipboard
data class NepaliWeekdayName(val short: String, val medium: String, val full: String)

Represents the name of a weekday in the Nepali calendar.

Link copied to clipboard
data class ReferenceDate(val englishDate: CustomCalendar, val nepaliDate: CustomCalendar)
Link copied to clipboard
data class SimpleDate(val year: Int, val month: Int, val dayOfMonth: Int = 1) : Comparable<SimpleDate>

Represents a simple date with year, month, and day of the month.

Link copied to clipboard
data class SimpleTime(val hour: Int, val minute: Int, val second: Int, val nanosecond: Int)

Represents a 24Hrs format time of day (hour, minute, second, nanosecond). Strictly adjusted to the Asia/Kathmandu TimeZone.

Properties

Link copied to clipboard

The CalendarSystem this calendar is expressed in, or CalendarSystem.BIKRAM_SAMBAT when CustomCalendar.era holds an unrecognised value.

Link copied to clipboard
Link copied to clipboard

One English/Bikram Sambat pair per English year, each falling on a Bikram Sambat new year.

Link copied to clipboard

The pairs of englishDateMap, keyed by Bikram Sambat year instead of English year.

Functions

Link copied to clipboard

Reverse lookup. If this char is a digit in any supported non-Latin script (Devanagari today), return the matching ASCII '0'..'9'. If it is already an ASCII digit, return it unchanged. Otherwise return null.

Link copied to clipboard

Reads this Bikram Sambat month as a calendar-tagged MonthCalendar.

Link copied to clipboard
Link copied to clipboard

Converts a CustomCalendar object to a SimpleDate object.