Sha256: 4038e67336f741e0ae170ff277bca30b9a6575c189348a5a6ab1dfee1a226358

Contents?: true

Size: 420 Bytes

Versions: 2

Compression:

Stored size: 420 Bytes

Contents

module DateMisc
  module LocalizedNames
    WDAY_NAMES = {
      ja: %w[日 月 火 水 木 金 土 日],
    }.freeze

    MONTH_NAMES = {
      ja: %w[睦月 如月 弥生 卯月 皐月 水無月 文月 葉月 長月 神無月 霜月 師走]
    }.freeze

    def wday_name(lang = :ja)
      WDAY_NAMES[lang][self.wday]
    end

    def month_name(lang = :ja)
      MONTH_NAMES[lang][self.month - 1]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
date_misc-1.1.1 lib/date_misc/localized_names.rb
date_misc-1.1.0 lib/date_misc/localized_names.rb