Method: Lazier::DateTime::ClassMethods#months

Defined in:
lib/lazier/datetime.rb

#months(short = true) ⇒ Array

Returns strings representations of months.

Parameters:

  • short (Boolean) (defaults to: true)

    If return the abbreviated representations.

Returns:

  • (Array)

    Return string representations of months.

See Also:



29
30
31
32
33
# File 'lib/lazier/datetime.rb', line 29

def months(short = true)
  ::Lazier.settings.date_names[short ? :short_months : :long_months].map.with_index {|label, index|
    {value: (index + 1).to_s.rjust(2, "0"), label: label}
  }
end