class ActivePeriod::Day
Public Instance Methods
holiday?(...)
click to toggle source
# File lib/active_period/day.rb, line 33 def holiday?(...) raise I18n.t(:gem_require, scope: %i[active_period holiday_period]) unless Object.const_defined?('Holidays') holidays(...).first.present? end
i18n() { |from, to| ... }
click to toggle source
# File lib/active_period/day.rb, line 22 def i18n(&block) return yield(from, to) if block.present? I18n.t(:default_format, scope: i18n_scope, wday: I18n.l(from, format: '%A').capitalize, day: from.day, month: I18n.l(from, format: '%B').capitalize, year: from.year) end
strftime(format)
click to toggle source
# File lib/active_period/day.rb, line 14 def strftime(format) from.strftime(format) end
to_s(format: '%d/%m/%Y')
click to toggle source
# File lib/active_period/day.rb, line 18 def to_s(format: '%d/%m/%Y') strftime(format) end