On 2011.2.12 10:40 AM, Jon Bjornstad wrote:
> How about adding a month_length method similar to is_leap_year?
>
> I peeked in the source to see one CAN do this:
>
> DateTime->_month_length($dt->year, $dt->month)
>
> to get the length of the month of a DateTime object but
> this is ugly and the _month_length method is supposed to be 'private'.
>
> Given the bountiful plethora of accessors I would have expected
> this to be present as well.
+1 especially if it's already there.
Bike shed: Would it be better as an object accessor giving the length of the
month of the current date? While internally it's used as a class method,
presumably DateTime users will already have an object and you'll want to know
how long its month is.
my $dt = DateTime->new( year => 2011, month => 2 );
print $dt->month_length; # 28
--
29. The Irish MPs are not after "Me frosted lucky charms".
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/