NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item2043: parseTime should return undef for invalid date

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine   Main.AndrewJones
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.

-- ArthurClemens - 12 Sep 2009

This is now fixed in both 1.0.x and 1.1.

I also removed the duplicate code from TablePlugin.

-- AndrewJones - 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.

-- CrawfordCurrie - 10 Feb 2010

Sorry about this, must have missed it. Will update the docs now.

-- AndrewJones - 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.

-- CrawfordCurrie - 12 Feb 2010

ItemTemplate edit

Summary parseTime should return undef for invalid date
ReportedBy ArthurClemens
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor AndrewJones
Checkins Foswikirev:4862 Foswikirev:5337 Foswikirev:5338 Foswikirev:5339 Foswikirev:6273 Foswikirev:6274
TargetRelease patch
ReleasedIn 1.0.7
Topic revision: r12 - 12 Feb 2010, CrawfordCurrie
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads