Item2043: parseTime should return undef for invalid date
Current State: Closed
Released In: 1.0.7
Target Release: patch
Applies To: Engine
With an invalid date, let's say 'a', Foswiki::Time::parseTime returns 0, which is equal to 1 Jan 1970. This makes it impossible to find bugs, or detect if a passed string is a date.
- 12 Sep 2009
This is now fixed in both 1.0.x and 1.1.
I also removed the duplicate code from TablePlugin
- 21 Oct 2009
The code has been modified, but the POD still says:
"If the date format was not recognised, will return 0."
Please, please, please make an effort to maintain the documentation! It was a hell of an effort to reverse engineer from the original undocumented code, and if it creeps out of synch it becomes worse than useless.
- 10 Feb 2010
Sorry about this, must have missed it. Will update the docs now.
- 11 Feb 2010
Thanks, Andrew, for your quick response. We probably would never have noticed this but for an IRC conversation in which MichaelDaum
and I were confused about the apparently stupid behaviour - because both of us had read the doc, but not the code! Sometimes I think doc is just plain dangerous.
- 12 Feb 2010