npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bengali-calendar

v8.0.14

Published

বাংলা তারিখ, সময়, মাস ও সপ্তাহের দিনের নাম সহ Bangla Calendar and Time Utility with TypeScript support.

Readme

Bangla Calendar

A TypeScript-supported NPM package for displaying dates and times in Bangla (Bengali) format.

Installation

You can install the package using npm:

npm i bengali-calendar

Usage

Importing the package

To use the bangla-calendar package, import it into your project:

import {
  toBanglaDigits,
  toEnglishDigits,
  formatBanglaDate,
  formatBanglaTime,
  formatBanglaTime12,
  getCurrentBanglaDateTime,
  getBanglaWeekNumber,
  getBanglaMonthFromEnglish,
  getDayName,
  getEnglishMonthName,
  getBanglaMonthName,
  formatBanglaDateWithBanglaMonth,
  formatFullBanglaDateTime,
} from "bangla-calendar";

Getting Bangla Date

  • Pass a JavaScript Date object to formatBanglaDate to get the date in Bangla format:
const banglaDate = formatBanglaDate(new Date());
// Output example: রবিবার, ১২ মার্চ ২০২৫

Getting Bangla Time

  • Use formatBanglaTime to format the time part of a Date object in Bangla digits:
const banglaTime = formatBanglaTime(new Date());
// Output example: ১৪:৩০:১৫

// Without seconds:
const banglaTimeShort = formatBanglaTime(new Date(), false);
// Output example: ১৪:৩০

Convert English digits to Bangla digits

  • Convert any string or number containing English digits to Bangla digits using toBanglaDigits
const banglaNumber = toBanglaDigits("1234567890");
// Output: ১২৩৪৫৬৭৮৯০

Get current Bangla date and time together

  • Use getCurrentBanglaDateTime to get both formatted date and time in Bangla as an object:
const { banglaDate, banglaTime } = getCurrentBanglaDateTime();
console.log(banglaDate); // রবিবার, ১২ মার্চ ২০২৫
console.log(banglaTime); // ১৪:৩০:১৫

Convert Bangla digits to English digits

import { toEnglishDigits } from "bangla-calendar";

const engNumber = toEnglishDigits("১২৩৪৫৬৭৮৯০");
// Output: "1234567890"

Get current Bangla date and time together

import { formatBanglaTime12 } from "bangla-calendar";

const time12 = formatBanglaTime12(new Date());
// Output example: ২:৩০:১৫ অপরাহ্ন

const time12NoSeconds = formatBanglaTime12(new Date(), false);
// Output example: ২:৩০ অপরাহ্ন

Get Bangla week number of the year

import { getBanglaWeekNumber } from "bangla-calendar";

const weekNum = getBanglaWeekNumber(new Date());
console.log(weekNum); // Output example: ১৫
  • Use getCurrentBanglaDateTime to get both formatted date and time in Bangla as an object:
const { banglaDate, banglaTime } = getCurrentBanglaDateTime();
console.log(banglaDate); // রবিবার, ১২ মার্চ ২০২৫
console.log(banglaTime); // ১৪:৩০:১৫

Get Bangla Month from English Date

  • Convert a Gregorian date's English month to approximate Bangla calendar month name.
import { getBanglaMonthFromEnglish } from "bangla-calendar";

const banglaMonth = getBanglaMonthFromEnglish(new Date());
// Output example: 'চৈত্র' (depending on current month)

Get Day Name (Bangla)

  • Get the Bangla name of the weekday for a given date
import { getDayName } from "bangla-calendar";

const dayName = getDayName(new Date());
// Output example: 'রবিবার'

Get English Month Name (Bangla Digits)

  • Get the English (Gregorian) month name in Bangla script.
import { getEnglishMonthName } from "bangla-calendar";

const engMonthName = getEnglishMonthName(new Date());
// Output example: 'মার্চ'

Get Bangla Month Name (Bengali Calendar)

  • Get the Bangla calendar month name from a given Date.
import { getBanglaMonthName } from "bangla-calendar";

const banglaCalMonth = getBanglaMonthName(new Date());
// Output example: 'ফাল্গুন'

Format Bangla Date with Bangla Month

  • Returns Bangla date string showing only day (in Bangla digits) and Bengali calendar month.
import { formatBanglaDateWithBanglaMonth } from "bangla-calendar";

const formattedDate = formatBanglaDateWithBanglaMonth(new Date());
// Output example: '১২ ফাল্গুন'

Format Full Bangla DateTime

  • Returns a full date-time string including day name, Bangla date, Bengali calendar month, year and time.
import { formatFullBanglaDateTime } from "bangla-calendar";

const fullDateTime = formatFullBanglaDateTime(new Date());
// Output example: 'রবিবার, ১২ ফাল্গুন ২০২৫, সময়: ১৪:৩০:১৫'

Get Bangla English Full Date Time Info

  • Returns separate detailed objects for both Bangla and English date-time info including day, month, year, weekday, and time (12h & 24h).
import { getBanglEnglishFullDateTimeInfo } from "bangla-calendar";

const dateInfo = getBanglEnglishFullDateTimeInfo(new Date());

console.log(dateInfo.bangla);
// Example output:
// {
//   day: '২২',
//   month: 'শ্রাবণ',
//   year: '১৪৩২',
//   weekday: 'বুধবার',
//   time24: '১৪:৩০:১৫',
//   time12: '২:৩০:১৫ অপরাহ্ন'
// }

console.log(dateInfo.english);
// Example output:
// {
//   day: 6,
//   month: 'August',
//   year: 2025,
//   weekday: 'Wednesday',
//   time24: '14:30:15',
//   time12: '2:30:15 PM'
// }

Format Full Bangla English DateTime

  • Returns a single formatted string combining Bangla and English date-time info side by side.
import { formatFullDateTimeDual } from "bangla-calendar";

const formattedDateTime = formatFullDateTimeDual(new Date());
// Example output:
// 'বুধবার, ২২ শ্রাবণ ১৪৩২ (১৪:৩০ অপরাহ্ন) | Wednesday, 6 August 2025 (4:30 PM)'

console.log(formattedDateTime);

Features

  • Converts Gregorian calendar dates to Bangla calendar format.
  • Supports Bangla month names, day names, and numbers.
  • Displays time in Bangla format with AM/PM.
  • TypeScript support with type definitions.
  • ES Module support for modern JavaScript applications.

Development

To build the package, run:

npm run build

To run tests:

npm test

License

This project is licensed under the MIT License.