Methods
Public Instance methods
days_in_month()

Returns the number of days in the date‘s month.

  Date.new(2004,2).days_in_month #=> 28

 CREDIT: Ken Kunz.
# File lib/lore/facets/date.rb, line 61
  def days_in_month
     Date.civil(year, month, -1).day
  end
days_of_month()
# File lib/lore/facets/date.rb, line 65
  def days_of_month
    (1..days_in_month).to_a
  end
month_name()

Get the month name for this date object

 CREDIT Benjamin Oakes
# File lib/lore/facets/date.rb, line 73
  def month_name
    MONTHNAMES[self.month]
  end
stamp(format = nil)

An enhanched to_s method that cane take an optional format flag of :short or :long.

This method is also aliased as to_s
# File lib/lore/facets/date.rb, line 41
  def stamp(format = nil)
    case format
    when :short
      strftime("%e %b").strip
    when :long
      strftime("%B %e, %Y").strip
    else
      strftime("%Y-%m-%d")  # standard to_s
    end
  end
to_date()

To be able to keep Dates and Times interchangeable on conversions.

# File lib/lore/facets/date.rb, line 29
  def to_date
    self
  end
to_s(format = nil)

Alias for stamp

to_time(form = :local)

Convert Date to Time.

# File lib/lore/facets/date.rb, line 35
  def to_time(form = :local)
    ::Time.send(form, year, month, day)
  end