parse

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

Returns null when:

  • length does not match pattern.length,

  • any year/month/day token is not numeric,

  • month is not in 1..12,

  • dayOfMonth is not in 1..32 (32 is allowed because some BS months have 32 days; tighter "real" validation that hits the converter and reports total days in month is the caller's job - usually via NepaliSelectableDates + NepaliCalendarModel).

Delimiters must match pattern.delimiter exactly. Trailing/leading whitespace is NOT trimmed - text fields should call String.trim() first if they care.