Module: MultiparameterDateTime

Extended by:
ActiveSupport::Concern
Defined in:
lib/multiparameter_date_time.rb,
lib/multiparameter_date_time/version.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

VALID_DATE_FORMAT =
/\A((\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4})\z|(\d{4}-\d{1,2}-\d{1,2})\z)/
VALID_STANDARD_TIME_FORMAT =
/\A[0]*([1-9]|1[0-2]):\d{2}(:\d{2})?\s*([apAP][mM])?\s*([A-Z]{3,5})?\Z/
VALID_MILITARY_TIME_FORMAT =
/\A[0]*([0-9]|1[0-9]|2[0-3]):\d{2}(:\d{2})?\s*([A-Z]{3,5})?\Z/
DEFAULT_DATE_FORMAT =
'%-m/%-d/%0Y'
DEFAULT_TIME_FORMAT =
'%-I:%0M %P'
VERSION =
'0.5.0'

Class Method Summary collapse

Class Method Details

.date_formatObject



19
20
21
# File 'lib/multiparameter_date_time.rb', line 19

def self.date_format
  @@date_format ||= DEFAULT_DATE_FORMAT
end

.time_formatObject



23
24
25
# File 'lib/multiparameter_date_time.rb', line 23

def self.time_format
  @@time_format ||= DEFAULT_TIME_FORMAT
end