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

Moment-timezone Dependency #242

Open
malikarami opened this issue Sep 12, 2022 · 3 comments
Open

Moment-timezone Dependency #242

malikarami opened this issue Sep 12, 2022 · 3 comments

Comments

@malikarami
Copy link

Hi,

I am trying to config Moment-Jalaali to format date and time based on a timezone, and I have noticed that Moment-Timezone is a dependency of Moment-Jalaali. Can you please explain the reason behind that? Is Moment-Jalaali really dependent on Moment-Timezone? If so, and if the package is installed, Why does Moment-Jalaali fail to support moment.tz() functionality?

I have also found out that moment().tz('example-timezone').format() works and converts the timestamps to the example timezone but if you use moment().tz('example-timezone') without the tagging format() function, it would trough an error.

Thanks in advance for noticing.

@behrang
Copy link
Member

behrang commented Sep 18, 2022

Hi,

The reason for dependency is surely for calculating the date and time in accordance to day-light saving rules. If the dependency was not there, the calculated date and time would be wrong.

About the tz function not working, I'm not sure that it even existed when this project was created. But if you are interested, we welcome pull-requests.

@malikarami
Copy link
Author

malikarami commented Sep 18, 2022

So if the moment-timezone dependency is there and I suppose it is also adding to the final bundle size, why don't you (moment-jalaali) support the tz functionalities for Iran timezone?

About the PR, I noticed that someone had opened such a request but that was closed due to the fact that moment-timezone is a heavy package.

PS: Am I correct in assuming that in the projects that use moment-jalaali, the moment-timezone lib is also included in the final bundle?

@behrang
Copy link
Member

behrang commented Sep 24, 2022

If you are interested in working on this issue, check here: #216 (comment)

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

2 participants