jalaali / moment-jalaali

A Jalaali (Jalali, Persian, Khorshidi, Shamsi) calendar system plugin for moment.js.
MIT License
940 stars 162 forks source link

Maybe the plugin needs an update #254

Open babakgm opened 1 year ago

babakgm commented 1 year ago
<script src="node_modules/moment/min/moment.min.js"></script>
<script src="node_modules/moment-jalaali/build/moment-jalaali.js"></script>
<script>
  moment().format('jYYYY/jM/jD')
</script>

this code show wrong format j2023/j8/j22

behrang commented 1 year ago

Changing line 4 of index.js to

var moment = require('moment')

and building again with npm run build will fix it.


I lost control of the latest dependency issues in this project, with all the different ways to JS modules. Changing it may also break others code using it. Since I think this project is retiring, it's best to not change it that much.

babakgm commented 1 year ago

tanks, alot If this project is being retired and you think it will have problems in the future, would you suggest a similar jalali callender or something better for the Jalali calendar with the fromnow function?

behrang commented 1 year ago

As mentioned on the Readme, you may use Intl which is an ECMAScript Internationalization standard to display dates. If you need more, maybe jalaali/jalaali-js might be helpful.