Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/category_generator/time_override.rb

Overview

Overriding Time class

Instance Method Summary collapse

Instance Method Details

#strftime_with(format, months) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/jekyll/category_generator/time_override.rb', line 7

def strftime_with(format, months)
  if months
    months = [nil] + months.split(' ')
    format = format.dup
    format.gsub!(/%B/, months[mon])
  end
  strftime(format)
end