Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10799 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] days_in_month should use current year

Reported by: Radar Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: days_in_month verified
Cc:

Description

days_in_month should use the current year. This is infuriating when you try to use it and have to specify a year (such as the one we're in now 2008). Using the new syntax all you have to type is days_in_month(2) and it'll show 29 days for February if the current year is a leap year, as this is more ideal behaviour. If you want to see days_in_month for a month from a previous or future year, then you should specify the year.

Attachments

days_in_month.diff (1.6 kB) - added by Radar on 01/15/08 23:28:19.

Change History

01/14/08 06:39:49 changed by naughtyneighbor

+1

01/15/08 23:10:05 changed by railsjitsu

+1

01/15/08 23:28:19 changed by Radar

  • attachment days_in_month.diff added.

01/15/08 23:40:30 changed by DefV

  • keywords changed from days_in_month to days_in_month, Verified.

Seems logical to me.. I can't think of a case where the old behaviour could be useful..

+1

01/15/08 23:41:46 changed by DefV

  • keywords changed from days_in_month, Verified to days_in_month verified.

01/25/08 03:29:23 changed by gbuesing

  • status changed from new to closed.
  • resolution set to fixed.

(In [8715]) Time.days_in_month defaults to current year if no year is supplied as argument, uses Date.gregorian_leap? to determine leap year, and uses constant lookup to determine days in month. Closes #10799 [Radar]