fix: take DST into account in augend.date["%H:%M"] #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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