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

jalali-moment

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jalali-moment

Display, parse, manipulate ,validate and convert jalali (Persian, Khorshidi, Shamsi) date and time

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.3K
increased by0.57%
Maintainers
1
Weekly downloads
 
Created
Source

Jalali Moment

Display, parse, manipulate and validate jalali (Persian, Khorshidi, Shamsi) or Gregorian (Miladi) dates and times and also convert Jalali (Persian, Khorshidi, Shamsi) date to Gregorian (Miladi) or vice versa in javascript or typescript.DEMO

Read this in other languages: فارسی

MIT License Build Status NPM version Package Quality dependencies Quality dev dependencies Quality Codacy Badge Codacy Badge

How to use

  • Install

  • How to use jalali moment in

  • API

    This plugin provide using jalali and gregorian calendar system together on momentjs api.

    .locale('fa'); it will use jalali calendar system

    .locale('any other locale'); it will use gregorian calendar system

    • Parse
      moment.locale('fa'); // set fa locale for all new moment instances
      var m1 = moment("1367/11/04","YYYY/MM/DD");
      
    • Display
       m1.format("YYYY/MM/DD"); // 1367/11/04
      
    • Manipulate
      m1.add(1, "day").format("YYYY/MM/DD"); // 1367/11/05
      
    • Validate
      m1.isValid(); // true
      
    • jalali to Gregorian
      moment('1367/11/04', 'YYYY/MM/DD').locale('en').format('YYYY/MM/DD'); // 1989/01/24
      //set en locale just for this instance  
      
    • Gregorian to jalali
      moment.locale('en');
      moment('1989/01/24').locale('fa').format('YYYY/MM/DD'); // 1367/11/04
      

Keywords

FAQs

Package last updated on 31 Oct 2017

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