NepaliDateConverter

Properties

Link copied to clipboard

Gets the current time in Kathmandu.

Link copied to clipboard

Strictly adjusted to Asia/Kathmandu TimeZone.

Link copied to clipboard

Strictly adjusted to Asia/Kathmandu TimeZone.

Link copied to clipboard

Strictly adjusted to Asia/Kathmandu TimeZone.

Link copied to clipboard

Functions

Link copied to clipboard
fun NepaliDateConverter.addWorkingDays(from: SimpleDate, days: Int, provider: NepaliHolidayProvider, weekend: Set<Int> = NepaliWeekend.Default): SimpleDate

Returns the date that is days working days from from, skipping weekend and holidays from provider. Follows Excel WORKDAY semantics:

Link copied to clipboard
fun AfterDateSelectable(simpleDate: SimpleDate, includeDate: Boolean = false): NepaliSelectableDates

Allows selection of dates after a given date.

Link copied to clipboard
fun BeforeDateSelectable(simpleDate: SimpleDate, includeDate: Boolean = false): NepaliSelectableDates

Allows selection of dates before a given date.

Link copied to clipboard
fun compareDates(dateToCompareFrom: CustomCalendar, dateToCompareTo: CustomCalendar): Int

Overloaded function of above compareDates function.

fun compareDates(dateToCompareFrom: CustomCalendar, dateToCompareTo: SimpleDate): Int

Compares a CustomCalendar instance with a date represented by the given SimpleDate.

fun compareDates(simpleDate: SimpleDate, year: Int, month: Int, dayOfMonth: Int): Int

Compares a SimpleDate instance with a date represented by the given year, month, and dayOfMonth.

Link copied to clipboard
fun convertEnglishToNepali(englishYYYY: Int, englishMM: Int, englishDD: Int): CustomCalendar

This function converts english date to nepali date.

Link copied to clipboard
fun convertNepaliToEnglish(nepaliYYYY: Int, nepaliMM: Int, nepaliDD: Int): CustomCalendar

This function converts nepali date to english date.

Link copied to clipboard

This function converts String to English, i.e. converts nepali numbers of string to english numbers.

Link copied to clipboard

This function converts String to Nepali, i.e. converts english numbers of string to nepali numbers.

Link copied to clipboard
fun DateRangeSelectable(minDate: SimpleDate, maxDate: SimpleDate, includeMinDate: Boolean = false, includeMaxDate: Boolean = false): NepaliSelectableDates

Creates a NepaliSelectableDates object that represents a selectable date range.

Link copied to clipboard

Overload function of above formatEnglishDate function without date range validation.

fun formatEnglishDate(year: Int, month: Int, dayOfMonth: Int, dayOfWeek: Int, locale: NepaliDateLocale): String

Formats a English date based on the specified user preferences.

Link copied to clipboard
fun formatEnglishDateByUnicodePattern(unicodePattern: String, calendar: CustomCalendar, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH): String

Formats an English date based on the specified Unicode pattern and language preferences.

Link copied to clipboard
fun formatEnglishDateNepaliTimeToIsoFormat(englishDate: SimpleDate, time: SimpleTime = currentTime): String

Converts an English (Gregorian) date and time to ISO 8601 UTC format.

Link copied to clipboard
fun formatEnglishDateTimeByUnicodePattern(unicodePattern: String, calendar: CustomCalendar, time: SimpleTime? = null, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH): String

Formats an English date and time based on the specified Unicode pattern and language preferences.

Link copied to clipboard

Overload function of above formatNepaliDate function without date range validation.

fun formatNepaliDate(year: Int, month: Int, dayOfMonth: Int, dayOfWeek: Int, locale: NepaliDateLocale): String

Formats a Nepali date based on the specified user preferences. (Without date range validation)

Link copied to clipboard
fun formatNepaliDateByUnicodePattern(unicodePattern: String, calendar: CustomCalendar, language: NepaliDatePickerLang = NepaliDatePickerLang.NEPALI): String

Formats a Nepali date based on the specified Unicode pattern and language preferences.

Link copied to clipboard
fun formatNepaliDateTimeByUnicodePattern(unicodePattern: String, calendar: CustomCalendar, time: SimpleTime? = null, language: NepaliDatePickerLang = NepaliDatePickerLang.NEPALI): String

Formats a Nepali date and time based on the specified Unicode pattern and language preferences.

Link copied to clipboard
fun formatNepaliDateTimeToIsoFormat(nepaliDate: SimpleDate, time: SimpleTime = currentTime): String

Converts a Nepali (Bikram Sambat) date and time to ISO 8601 UTC format.

Link copied to clipboard
fun formatTimeByUnicodePattern(unicodePattern: String, time: SimpleTime, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH): String

Formats a time based on the specified Unicode pattern and language preferences.

Link copied to clipboard

Converts ISO 8601 UTC format to CustomDateTime which represents the English CustomCalendar and Nepali SimpleTime.

Link copied to clipboard

Calculates the total number of days between two SimpleDate objects in the English calendar.

Link copied to clipboard
fun getEnglishMonthName(month: Int, format: NameFormat = NameFormat.FULL, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH): String
Link copied to clipboard
fun getFormattedTimeInEnglish(simpleTime: SimpleTime, use12HourFormat: Boolean = true): String

Formats a SimpleTime object into a time string in English.

Link copied to clipboard
fun getFormattedTimeInNepali(simpleTime: SimpleTime, use12HourFormat: Boolean = true): String

Formats a SimpleTime object into a Nepali time string.

Link copied to clipboard
fun getMonthName(month: Int, format: NameFormat = NameFormat.FULL, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH): String
Link copied to clipboard
fun getNepaliCalendar(nepaliYYYY: Int, nepaliMM: Int, nepaliDD: Int): CustomCalendar

Returns the Nepali calendar representation for a specific Nepali date (year, month, day). This function retrieves the CustomCalendar object that holds detailed information about the Nepali date including the total days in the month, the day of the week, and other necessary calendar data.

fun getNepaliCalendarAfterAdditionOrSubtraction(year: Int, month: Int, dayOfMonth: Int, daysToAdjust: Int): CustomCalendar

Adjusts a given Nepali date by adding or subtracting number of days.

Link copied to clipboard

Converts ISO 8601 UTC format to CustomDateTime which represents the Nepali CustomCalendar and Nepali SimpleTime.

Link copied to clipboard
fun getNepaliDaysInBetween(startDate: SimpleDate, endDate: SimpleDate): Int

Calculates the total number of days between two SimpleDate objects in the Nepali calendar.

Link copied to clipboard
fun getNepaliMonthCalendar(nepaliYear: Int, nepaliMonth: Int): NepaliMonthCalendar

This function gives particular Nepali month details in Nepali calendar.

Link copied to clipboard

This function returns total days in a English month.

Link copied to clipboard
fun getTotalDaysInNepaliMonth(year: Int, month: Int): Int

This function returns total days in a Nepali month.

Link copied to clipboard
fun getWeekdayName(dayOfWeek: Int, format: NameFormat = NameFormat.FULL, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH): String
Link copied to clipboard

Localize Latin digits in this string to the given script.

Localize Latin digits in this string to the digit script implied by locale.

Link copied to clipboard

This function localizes String to either English or Nepali, i.e. converts english numbers of string to nepali numbers, and vice versa.

Link copied to clipboard
fun NepaliDateConverter.nextWorkingDay(from: SimpleDate, provider: NepaliHolidayProvider, weekend: Set<Int> = NepaliWeekend.Default): SimpleDate

First working day at or after from, skipping both weekend days and dates flagged by provider.

Link copied to clipboard
fun replaceDelimiter(dateString: String, newDelimiter: String, oldDelimiter: String = "/"): String

Replaces the delimiter in a date string formatted with the original delimiter.

Link copied to clipboard

Inverse of localizeDigits. Convert digits in any supported non-Latin script back to ASCII 0-9. Non-digit characters pass through unchanged.

Link copied to clipboard
fun NepaliDateConverter.workingDaysBetween(start: SimpleDate, end: SimpleDate, provider: NepaliHolidayProvider, weekend: Set<Int> = NepaliWeekend.Default): Int

Number of working days in the half-open range [start, end), skipping both weekend days and dates flagged by provider.