jalaali / moment-jalaali

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

How to set default value on moment-timezone #217

Open amirlix opened 3 years ago

amirlix commented 3 years ago

HI . in moment-timezone have setDefault option for set default time-zone. How to use this with moment-jalaali ? https://momentjs.com/timezone/docs/#/using-timezones/default-timezone/

import moment from 'moment-jalaali';
import 'moment-timezone';

moment.tz.setDefault("America/Lima");

// err: Cannot read property 'setDefault' of undefined
DevIsShortForDevil commented 2 years ago

I have a similar problem that prevents usage of "moment-timezone" functions in "moment-jalaali". if you could use "moment-timezone" instead of regular "moment" library , it would make it a lot easier to use with time zones.

mNajarzadeh commented 1 year ago

temporary solution : import moment from 'moment-jalaali'; moment('2023-01-19 06:32:27').add(3.5, 'hours').format('jYYYY/jM/jD HH:mm') you can write wrapper and use different timezone