Open youve opened 5 years ago
I think it happens because when there's a relative date, a timedelta is added to now, so the timedelta fills in tm_yday for us. When there's an exact date, tm_yday just isn't filled in at all so it's defaulting to today's tm_yday.
yeah. see:
>>> cal.parse('3rd december')
(time.struct_time(tm_year=2018, tm_mon=12, tm_mday=3, tm_hour=23, tm_min=19, tm_sec=58, tm_wday=0, tm_yday=330, tm_isdst=0), 1)
>>> cal.parse('today plus 3rd december')
2018-11-26 23:20:02,681 - DEBUG - eval plus with context - True, False
(time.struct_time(tm_year=2018, tm_mon=12, tm_mday=3, tm_hour=9, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=337, tm_isdst=-1), 1)
First thanks for making parsedatetime. It's really great.
These are correct:
This is wrong:
As you can see, today is the 328th day of the year, and next Saturday is the 335th day of the year. But if I tell it to parse "December 1st" then suddenly next Saturday has the same tm_yday as today.
I think this bug is with parsedatetime and not upstream because
time
gets it right: