bear / parsedatetime

Parse human-readable date/time strings
Apache License 2.0
694 stars 107 forks source link

"End of day" gets confused when combined with modifiers like "tomorrow" #189

Open pbdeuchler opened 8 years ago

pbdeuchler commented 8 years ago
>>> cal.parse("end of day")
(time.struct_time(tm_year=2016, tm_mon=9, tm_mday=2, tm_hour=17, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=246, tm_isdst=1), 3)

>>> cal.parse("tomorrow end of day")
(time.struct_time(tm_year=2016, tm_mon=9, tm_mday=3, tm_hour=9, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=247, tm_isdst=-1), 3)

>>> cal.parse("tomorrow start of day")
(time.struct_time(tm_year=2016, tm_mon=9, tm_mday=3, tm_hour=9, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=247, tm_isdst=-1), 1)

As you can see, "tomorrow end of day" ends up being the same time as "tomorrow start of day" (9am), while a regular "end of day" implicates 5pm