
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@zoomit/dayjs-jalali-plugin
Advanced tools
Persian (Jalali, Khorshidi) Plugin for Day.js, Jalaliday add multi-calendar functionality to Day.js core regardless for of locale, so we can have Gregorian calendar is Persian locale of Jalali calendar in English locale
Unlike moment and becuase of immutablity of dayjs, there is no need for formats like jYYYY
or jMM
, in Jalaliday all formats are same and standard
NPM
npm install --save jalaliday
YARN
yarn add jalaliday
import dayjs from 'dayjs'
import jalaliday from 'jalaliday'
dayjs.extend(jalaliday)
If you want to all new instanses of dayjs use jalali
calendar, you can set default calendar
dayjs.calendar('jalali') // Jalali Calendar
// OR
dayjs.calendar('gregory') // Gregorian Calendar
also you can create a jalali date without changing default calendar
const date = dayjs()
const jalaliDate = date.calendar('jalali')
const date = dayjs('2018-04-04T16:00:00.000Z');
const date = dayjs('1398-10-17', { jalali: true });
with combination of calendar
and locale
we have multi language for real
dayjs().calendar('jalali').locale('en').format('DD MMMM YYYY') // '13 Shahrivar 1397'
dayjs().calendar('gregory').locale('fa').format('DD MMMM YYYY') // '04 سپتامبر 2018'
All Api operations of Jalaliday is same as Dayjs itself but calendar based, for more information checkout Dayjs API For a glance:
.format(stringWithTokens: string)
.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)
.valueOf()
.unix()
.daysInMonth()
.toDate()
.toArray()
.toJSON()
.toISOString()
.toObject()
.toString()
FAQs
Persian (Jalali, Khorshidi) Plugin for Day.js
The npm package @zoomit/dayjs-jalali-plugin receives a total of 416 weekly downloads. As such, @zoomit/dayjs-jalali-plugin popularity was classified as not popular.
We found that @zoomit/dayjs-jalali-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.