Module: JapaneseCalendar::Weekday

Includes:
Deprecator
Included in:
Date, DateTime, Time
Defined in:
lib/japanese_calendar/weekday.rb,
lib/japanese_calendar/weekday/deprecator.rb

Defined Under Namespace

Modules: Deprecator

Instance Method Summary collapse

Instance Method Details

#strftime(format) ⇒ Object

Formats time according to the directives in the given format string.

date_of_birth = Time.new(1978, 7, 19)

date_of_birth.strftime("%JA")  # => "水曜日"
date_of_birth.strftime("%Ja")  # => "水"

date_of_birth.strftime("%-Y年%-m月%-d日(%Ja)") # => "1978年7月19日(水)"


17
18
19
20
# File 'lib/japanese_calendar/weekday.rb', line 17

def strftime(format)
  string = format.gsub(weekday_pattern, weekday_conversion)
  super(string)
end