formatEnglishDateByUnicodePattern
Formats an English date based on the specified Unicode pattern and language preferences.
Return
A string representing the formatted date according to the provided Unicode pattern and language preferences.
The function supports the following placeholders in the unicodePattern:
yyyy: Four-digit year (e.g., "2025" or "२०२५")yy: Two-digit year (e.g., "25" or "२५")MMMM: Full month name (e.g., "January" or "जनवरी")MMM: Abbreviated month name (e.g., "Jan" or "जन")MM: Two-digit month (e.g., "01" or "०१")M: Month number, no padding (e.g., "1" or "१")dd: Two-digit day of month (e.g., "04" or "०४")d: Day of month, no padding (e.g., "4" or "४")D: Day of the year (1–366) (e.g., "123" or "१२३")w: Week of the year (e.g., "23" or "२३")EEEE: Full weekday name (e.g., "Monday" or "सोमबार")E: Medium weekday name (e.g., "Mon" or "सोम")EEEEE: Short weekday name, if defined (e.g., "M" or "स")ee: Two-digit day of week (e.g., "02" or "०२")e: Day of week, no padding (e.g., "2" or "२")
Example usage:
val calendar = CustomCalendar(year = 2025, month = 5, dayOfMonth = 14, dayOfWeek = 3,...)
val formattedDateTime = formatEnglishDateByUnicodePattern(
"yyyy-MM-dd EEEE",
calendar,
NepaliDatePickerLang.ENGLISH
)
// formattedDateTime: "2025-05-14 Tuesday"Parameters
A CustomCalendar representing the date.
A string specifying the pattern to use for formatting the date and time. The pattern supports various placeholders like "yyyy", "MM", "dd", "D", "w", "E", etc.
The NepaliDatePickerLang specifying the language for formatting the date and time.