Created
February 11, 2018 15:28
-
-
Save matinkaboli/dcc08e47632db28937dcdcc1a7e3183e to your computer and use it in GitHub Desktop.
Show persian date with moment-jalaali in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import moment from 'moment-jalaali'; | |
moment.loadPersian({ usePersianDigits: true, dialect: 'persian-modern' }); | |
const persianDate = date => moment(date).fromNow(); | |
export default persianDate; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment