Timecop has no effect when parsing Dates #59

Closed
quidproquo opened this Issue Jan 3, 2013 · 1 comment

Comments

Projects
None yet
2 participants

When I do the following:

Timecop.travel(Date.parse('Dec 15, 2012')
d = Date.parse('Dec 15')
d == Date.parse('Dec 15, 2013')

parse just assumes it is current real year.

Any way to fix or advice? I wouldn't mind putting in a pull request, though not sure where to start.

Thanks,
Ilya

Collaborator

jtrupiano commented Jan 3, 2013

Date#parse is implemented by Ruby stdlib's Date class. http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html#method-c-parse

You would need to patch its behavior there.

jtrupiano closed this Jan 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment