Module: TimeCrisis::Support::Change::DateTime

Defined in:
lib/time_crisis/support/change.rb

Instance Method Summary collapse

Instance Method Details

#change(options = {}) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/time_crisis/support/change.rb', line 78

def change(options={})
  ::DateTime.civil(
    options[:year]  || year,
    options[:month] || month,
    options[:day]   || day,
    options[:hour]  || hour,
    options[:min]   || (options[:hour] ? 0 : min),
    options[:sec]   || ((options[:hour] || options[:min]) ? 0 : sec),
    options[:offset]  || offset,
    options[:start]  || start
  )
end