to-bengali
v1.0.2
Published
A lightweight npm package to translate numbers and dates to Bengali language.
Downloads
202
Maintainers
Readme
To Bengali
To Bengali is a lightweight npm package for translating numbers and dates to Bengali language. It's perfect for developers who need to localize their applications for Bengali speakers.
Installation
To install this package, use npm:
npm i to-bengali
Usage
To Bengali exports two Class: Bengali Date and Bengali Number.
Bengali Date
To import Bengali Date class:
import {BengaliDate} from 'to-bengali';
To use this class:
const date = new Date('29 november, 1998');
const bngDateTime = new BengaliDate(date); // BengaliDate() will return current date-time
console.log(bngDateTime.bngDate); // output: ২৯
Properties:
Methods:
const date = new Date('29 november, 1998');
const bngDateTime = new BengaliDate(date).format('DD MMMM, YYYY dddd AAAA hh:mm:ss')
console.log(bngDateTime); // output: ২৯ নভেম্বর, ১৯৯৮ রবিবার রাত ১২:০০:০০
Others supported patterns:
Bengali Number
To import Bengali Number class:
import {BengaliNumber} from 'to-bengali';
To use this class:
const bengaliNumber = new BengaliNumber(100);
console.log(bengaliNumber.bngValue); // output: ১০০
Properties:
*more description will be added later.
Contributing
If you find a bug or would like to contribute to the project, please check out the contribution guidelines.
License
To Bengali is licensed under the MIT license.