class Period::Week

@author Lucas Billaudot <billau_l@modulotech.fr> @note One of the StandardPeriod defined in the gem

Public Instance Methods

i18n() { |from, to| ... } click to toggle source
# File lib/period/week.rb, line 28
def i18n(&block)
  return yield(from, to) if block.present?

  I18n.t(:default_format,
         scope: i18n_scope,
         week:  strftime('%V'),
         year:  strftime('%G'))
end
iso_date() click to toggle source
# File lib/period/week.rb, line 37
def iso_date
  from + 3.days
end
strftime(format) click to toggle source
# File lib/period/week.rb, line 20
def strftime(format)
  from.strftime(format)
end
to_s(format: '%V - %G') click to toggle source
# File lib/period/week.rb, line 24
def to_s(format: '%V - %G')
  strftime(format)
end