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

fix: take DST into account in augend.date["%H:%M"] #74

Merged
merged 1 commit into from Aug 27, 2023

Conversation

ThomasFaivre
Copy link
Contributor

@ThomasFaivre ThomasFaivre commented Aug 24, 2023

Hello!

I was having issues with dial not working on "%H:%M".
I tracked down the issue to the way os.date handles Daylight Saving Time.

The fix itself is quite easy.
Testing is another thing! I tried changing Time Zone in the spec file directly, but for some reason, os.date gets confused when changing Time Zone several times.
Therefore, run several nvim instances with various time zone settings to properly test DST in every case (no DST, permanent, North DST, South DST).

If you have remarks, or a better solution, I'm all ears! :-D

Thanks for this plugin!

--

When trying to increase/decrease a time from a Europe/Paris time zone, dial cannot find the time pattern because os.date will take DST into account and will return a time increased by 1 hour.

By preserving DST value from the host, consistency is ensured between the calls to os.date.

Run the date_spec.lua file with different time zones in order to correctly test DST during the whole year.

Link: https://en.wikipedia.org/wiki/Daylight_saving_time_by_country

When trying to increase/decrease a time from a Europe/Paris time zone,
dial cannot find the time pattern because `os.date` will take DST into
account and will return a time increased by 1 hour.

By preserving DST value from the host, consistency is ensured between
the calls to `os.date`.

Run the date_spec.lua file with different time zones in order to
correctly test DST during the whole year.

Link: https://en.wikipedia.org/wiki/Daylight_saving_time_by_country
Signed-off-by: Thomas Faivre <thfaivre@gmail.com>
Copy link
Owner

@monaqa monaqa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I live in an area without DST, so I was not aware of the problem when DST was introduced. Thank you!

@monaqa monaqa merged commit 5b9763e into monaqa:master Aug 27, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants