Module: Mo2tex::DateTimeHelper
- Included in:
- DaySchedule, Pic::Writer, SlotBase
- Defined in:
- lib/mo2tex/datetime_helper.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#datetime_create(day, t) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/mo2tex/datetime_helper.rb', line 7 def datetime_create(day, t) raise DayIsNotDateTime, "#{day}" unless day.class == DateTime raise TimeIsNotString, "#{t}" unless t.class == String (hours, minutes) = t.split(':').map { |n| n.to_i } result = DateTime.new(day.year, day.month, day.day, hours, minutes, 0) return result end |