Skip to content

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

FunctionInputDefault OutputKey Option
banglaToDigit()String with Bangla digitsnumber or stringforceNumber
digitToBangla()Number/String with Latin digitsstring with Bangla digitspreserveNonDigit

Independence

These utilities operate independently of BanglaCalendar instance objects and can be used across UI components, form validators, or database mappers.

Released under the Apache 2.0 License.