Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jalaliday

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jalaliday

Persian (Jalali, Khorshidi) Plugin for Day.js

  • 2.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5K
increased by1.36%
Maintainers
1
Weekly downloads
 
Created
Source

Jalaliday

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

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

📖 Release Notes

Installation

NPM

npm install --save jalaliday

YARN

yarn add jalaliday

Usage

import dayjs from 'dayjs'
import jalaliday from 'jalaliday'

dayjs.extend(jalaliday)

Changing calendar

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')

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'

API

All Api operations of Jalaliday is same as Dayjs itself but calendar based, for more information checkout Dayjs API For a glance:

Keywords

FAQs

Package last updated on 22 Sep 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc