Skip to content

Timezone / Summer time support #8

@chdanielmueller

Description

@chdanielmueller

Hi @xpepermint ,

As far as I can observe the library always works with UTC timestamps in the sleepUntil and interval field.
Is it possible to configure the library at the current state to react to summer time changes?

If not here is my idea:
I can see that the library uses moment.
In my code I use moment with the timezone extension. (moment-timezone)
I suppose with changing the imports from import moment from 'moment'; to import moment from 'moment-timezone'; and adding a default timezone moment.tz.setDefault('Europe/Zurich'); the behaviour could be altered.
Of course this would need a new option in the constructor. e.g. new MongoCron({..., timezon: 'Europe/Zurich'})

I didn't test it and have not looked deep into the code.
What do you think?

Thanks,
Daniel

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions