0.3.0 • Published 1 year ago
persian-leap v0.3.0
Persian Leap Year
A simple library to check if a Persian year is a leap year or not.
Based on this Wikipedia page which references the official Iranian calendar.
Installation
Install it via npm:
npm install persian-leapOr yarn:
yarn add persian-leapOr pnpm:
pnpm add persian-leapUsage
To check if a Persian year is a leap year or not, use the isPersianLeapYear() function.
import { isPersianLeapYear } from "persian-leap";
console.log(isPersianLeapYear(1403)); // true
console.log(isPersianLeapYear(1404)); // falseTo get the number of days in a Persian month, use the getDaysInPersianMonth() function.
import { getDaysInPersianMonth } from "persian-leap";
console.log(getDaysInPersianMonth(1403, 12)); // 30
console.log(getDaysInPersianMonth(1404, 12)); // 29