Closed ski-nine closed 1 year ago
require 'fugit'
Fugit.parse('every day at 5:00 pm').original
# => "0 17 * * *"
@ski-nine
Regarding 12am and 12pm, please read https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
I will most likely keep the current behaviour, but add "12 noon" and "12 midnight" for clarification.
If not fixing then the behaviour should be documented in the main page because of the potential to cause problems.
We are using Rufus scheduler https://github.com/jmettraux/rufus-scheduler and some jobs were incorrectly scheduled due to the above issues.
If not fixing then the behaviour should be documented in the main page because of the potential to cause problems.
From my point of view, it is not "not fixing". Yes, I will document my decision, thanks for the suggestion.
Just released fugit 1.7.2. Thanks for reporting those two issues.
Issue description
When parsing a string with a time value where the "pm" is not space delimited, the result is being parsed as a time in the morning.
Also, wrong result when parsing a string with a time value of "12:xx am".
How to reproduce
PM Bug:
12 AM/PM Bug:
Expected behaviour
PM Bug:
Either fix to return:
12 AM/PM Bug:
OR
Raise a parse exception.