Open GoogleCodeExporter opened 8 years ago
Have you looked into using the YearParseStyle constant?
parsedatetime.Calendar() will create a parsedatetime.Constants() object if you
don't pass one in, but if you do then you can override a lot about how it
handles those items.
The best docs are in the source for parsedatetime.Constants as each item has a
lot of comment text describing how it changes the way the parsing is handled.
Original comment by bear42
on 13 Jan 2011 at 8:11
I can't find any references to YearParseStyle either in my copy or in the repo.
Original comment by WinstonEwert
on 13 Jan 2011 at 8:40
oh wow - FAIL on my part - it's a local change I haven't posted yet.
I've attached a patch that implements it
Original comment by bear42
on 13 Jan 2011 at 10:50
Attachments:
So that patch makes it take the current year as the year. That certainly
handles most cases. The ideal situation would be if it would pick the closest
date either forwards or backwards.
I've solved my immediate problem by eliminating the skip forward logic in my
local copy.
Original comment by WinstonEwert
on 14 Jan 2011 at 12:05
hmm, then I must have read your description incorrectly. I'm planning on
giving the project some much needed bug and code love this weekend, so I will
look at implementing that behaviour as an option.
thanks!
Original comment by bear42
on 14 Jan 2011 at 4:19
I didn't describe what I'd ideally want. My actual concern was more that my
start date's year seemed to be ignored.
Original comment by WinstonEwert
on 15 Jan 2011 at 12:23
Original issue reported on code.google.com by
WinstonEwert
on 13 Jan 2011 at 3:21