Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set default value on moment-timezone #217

Open
amirlix opened this issue Mar 29, 2021 · 2 comments
Open

How to set default value on moment-timezone #217

amirlix opened this issue Mar 29, 2021 · 2 comments

Comments

@amirlix
Copy link

amirlix commented Mar 29, 2021

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
Copy link

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
Copy link

mNajarzadeh commented Jan 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants