[Jifty-commit] r1724 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Aug 1 17:46:32 EDT 2006


Author: nelhage
Date: Tue Aug  1 17:46:31 2006
New Revision: 1724

Modified:
   jifty/trunk/lib/Jifty/DateTime.pm

Log:
Workaround DateManip's parsing of bare days of weeks as references to
days in the current week, instead of assuming future days.

Modified: jifty/trunk/lib/Jifty/DateTime.pm
==============================================================================
--- jifty/trunk/lib/Jifty/DateTime.pm	(original)
+++ jifty/trunk/lib/Jifty/DateTime.pm	Tue Aug  1 17:46:31 2006
@@ -62,6 +62,13 @@
     my $string = shift;
     my $now;
     {
+        # Date::Manip interprets days of the week (eg, ''monday'') as
+        # days within the *curent* week. Detect these and prepend
+        # ``next''
+        # XXX TODO: Find a real solution (better date-parsing library?)
+        if($string =~ /^\s* (?:monday|tuesday|wednesday|thursday|friday|saturday|sunday)$/xi) {
+            $string = "next $string";
+        }
         local $ENV{'TZ'} = "GMT";
         $now = Date::Manip::UnixDate( $string, "%o" );
     }


More information about the Jifty-commit mailing list