Skip to content

Instantly share code, notes, and snippets.

@matinkaboli
Created February 11, 2018 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matinkaboli/dcc08e47632db28937dcdcc1a7e3183e to your computer and use it in GitHub Desktop.
Save matinkaboli/dcc08e47632db28937dcdcc1a7e3183e to your computer and use it in GitHub Desktop.
Show persian date with moment-jalaali in Node.js
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