NepaliDateFormatter

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

Use this when you have a raw YYYY/MM/DD-style string from a TextField and need a SimpleDate (or vice versa). For locale-aware long-form output ("Asar 21, 2082"), use NepaliDateConverter.formatNepaliDate(...) instead - this formatter is the primitive that backs NepaliDateTextField / NepaliDateField.

Supported Patterns are limited on purpose. A free-form DateTimeFormatter-style DSL is out of scope; the constrained surface keeps the masking and validation in the UI layer simple and predictable.

Types

Link copied to clipboard

Supported text-field input/output patterns.

Functions

Link copied to clipboard
fun format(date: SimpleDate, pattern: NepaliDateFormatter.Pattern, script: DigitScript = DigitScript.LATIN): String

Format date as a Pattern.literal-shaped string with digits in the given script.

Link copied to clipboard

Parse input as the given pattern. Accepts Latin digits and any non-Latin digit script registered in DigitScript (Devanagari today).