lib/timeliness/definitions.rb in timeliness-0.4.0 vs lib/timeliness/definitions.rb in timeliness-0.4.1

- old
+ new

@@ -73,14 +73,16 @@ 'dd-mm-yyyy h:nn_ampm', 'dd-mm-yyyy h:nn', 'ddd, dd mmm yyyy hh:nn:ss tz', # RFC 822 'ddd, dd mmm yyyy hh:nn:ss zo', # RFC 822 'ddd mmm d hh:nn:ss zo yyyy', # Ruby time string - 'yyyy-mm-ddThh:nn:ssZ', # ISO 8601 without zone offset + 'yyyy-mm-ddThh:nn:ss', # ISO 8601 'yyyy-mm-ddThh:nn:sszo', # ISO 8601 with zone offset + 'yyyy-mm-ddThh:nn:sszt', # ISO 8601 with 'Zulu time' (i.e. Z) UTC zone designator 'yyyy-mm-ddThh:nn:ss.u', # ISO 8601 with usec 'yyyy-mm-ddThh:nn:ss.uzo', # ISO 8601 with usec and offset + 'yyyy-mm-ddThh:nn:ss.uzt', # ISO 8601 with usec and 'Zulu time' (i.e. Z) UTC zone designator 'yyyy-mm-dd hh:nn:ss zo', # Ruby time string in later versions 'yyyy-mm-dd hh:nn:ss tz', # Ruby time string for UTC in later versions ] # All tokens available for format construction. The token array is made of @@ -103,10 +105,11 @@ 's' => [ '\d{1,2}', :sec ], 'u' => [ '\d{1,6}', :usec ], 'ampm' => [ '[aApP]\.?[mM]\.?', :meridian ], 'zo' => [ '[+-]\d{2}:?\d{2}', :offset ], 'tz' => [ '[A-Z]{1,5}', :zone ], + 'zt' => [ '[Z]{1}', :zulu], '_' => [ '\s?' ] } # Component argument values will be passed to the format method if matched in # the time string. The key should match the key defined in the format tokens. @@ -125,9 +128,10 @@ :min => [ 4 ], :sec => [ 5 ], :usec => [ 6, 'microseconds(usec)'], :offset => [ 7, 'offset_in_seconds(offset)'], :zone => [ 7, 'zone'], + :zulu => [ 7, 'offset_in_seconds("00:00")'], :meridian => [ nil ] } # Mapping some common timezone abbreviations which are not mapped or # mapped inconsistenly in ActiveSupport (TzInfo).