class Period::Day

Public Instance Methods

i18n() { |from, to| ... } click to toggle source
# File lib/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/period/day.rb, line 14
def strftime(format)
  from.strftime(format)
end
to_s(format: '%d/%m/%Y') click to toggle source
# File lib/period/day.rb, line 18
def to_s(format: '%d/%m/%Y')
  strftime(format)
end