🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

jalaali-js

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jalaali-js

Converts Gregorian and Jalaali calendars to each other

1.2.8
latest
Source
npm
Version published
Weekly downloads
210K
-3.28%
Maintainers
0
Weekly downloads
 
Created

What is jalaali-js?

The jalaali-js npm package provides utilities for converting between the Jalaali (Persian) calendar and the Gregorian calendar. It is useful for applications that need to support Persian date formats and conversions.

What are jalaali-js's main functionalities?

Convert Gregorian to Jalaali

This feature allows you to convert a Gregorian date to a Jalaali date. The `toJalaali` function takes a Gregorian year, month, and day as input and returns an object with the corresponding Jalaali year, month, and day.

const jalaali = require('jalaali-js');
const jalaaliDate = jalaali.toJalaali(2023, 10, 5);
console.log(jalaaliDate); // { jy: 1402, jm: 7, jd: 13 }

Convert Jalaali to Gregorian

This feature allows you to convert a Jalaali date to a Gregorian date. The `toGregorian` function takes a Jalaali year, month, and day as input and returns an object with the corresponding Gregorian year, month, and day.

const jalaali = require('jalaali-js');
const gregorianDate = jalaali.toGregorian(1402, 7, 13);
console.log(gregorianDate); // { gy: 2023, gm: 10, gd: 5 }

Check if a Jalaali year is a leap year

This feature allows you to check if a given Jalaali year is a leap year. The `isLeapJalaaliYear` function takes a Jalaali year as input and returns a boolean indicating whether it is a leap year.

const jalaali = require('jalaali-js');
const isLeap = jalaali.isLeapJalaaliYear(1402);
console.log(isLeap); // false

Other packages similar to jalaali-js

Keywords

jalaali

FAQs

Package last updated on 04 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts