Module Timeliness::Definitions
In: lib/timeliness/definitions.rb

Methods

Constants

US_FORMAT_REGEXP = /\Am{1,2}[^m]/
FormatNotFound = Class.new(StandardError)
DuplicateFormat = Class.new(StandardError)

Attributes

date_formats  [RW] 
datetime_formats  [RW] 
format_components  [RW] 
format_tokens  [RW] 
time_formats  [RW] 
timezone_mapping  [RW] 

Public Class methods

Adds new formats. Must specify format type and can specify a :before option to nominate which format the new formats should be inserted in front on to take higher precedence.

Error is raised if format already exists or if :before format is not found.

Returns format for type and other possible matching format set based on type and value length. Gives minor speed-up by checking string length.

Delete formats of specified type. Error raised if format not found.

Removes US date formats so that ambiguous dates are parsed as European format

Restores default to parse ambiguous dates as US format

[Validate]