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

Add timezone support #8

Open
P4sca1 opened this issue Oct 6, 2020 · 0 comments
Open

Add timezone support #8

P4sca1 opened this issue Oct 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@P4sca1
Copy link
Owner

P4sca1 commented Oct 6, 2020

At the moment, the cron jobs are checked against the local time.
When constructing a Schedule an optional timezone parameter could be used.
parseCronExpression would then get a second parameter timezone which is passed to the Schedule constructor.
For ease of use, it would be great if time zone names would be supported, but we would need to include and maintain a database of timezones. Also time zone offsets are not static but change over time and throughout the year. Maybe the timezone parameter should be a function utcOffset that returns the desired utc offset. One could then use other libraries such as moment-timezone to get the desired offset and cron-schedule bundle size would not increased (or use a peer dependency?). We also need to consider what happens when utcOffset returns diifferent offsets in subsequent calls (which might be realistic due to summer time / DST).

@P4sca1 P4sca1 added the enhancement New feature or request label Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant