Utilities Overview
bn-calendar provides standalone digit conversion utilities via the bn-calendar/utils subpath. These functions allow converting between Bengali digits (০-৯) and Latin/Arabic digits (0-9). It also provides standalone type guards to validate values independent of the core class.
Import Path
typescript
import { banglaToDigit, digitToBangla } from 'bn-calendar/utils';Functions at a Glance
| Function | Input | Default Output | Key Option |
|---|---|---|---|
banglaToDigit() | String with Bangla digits | number or string | forceNumber |
digitToBangla() | Number/String with Latin digits | string with Bangla digits | preserveNonDigit |
Independence
These utilities operate independently of BanglaCalendar instance objects and can be used across UI components, form validators, or database mappers.