Skip Menu |

Preferred bug tracker

Please email the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime-Calendar-Christian CPAN distribution.

Report information
The Basics
Id: 116999
Status: resolved
Priority: 0/
Queue: DateTime-Calendar-Christian

People
Owner: wyant [...] cpan.org
Requestors: wyant [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.04
Fixed in: 0.04_01



Subject: Missing today() method [patch]
The DateTime interface includes a static today() method which instantiates a new object representing midnight on the current day. This method is missing from DateTime::Calendar::Christian. The attached patch adds the method. The patch is against the published copy of DateTime::Calendar::Christian 0.04. The code is a direct steal from DateTime, and I think *today = \&DateTime::today; would work just as well. The importance was assigned because today() is a convenience method (since DateTime implements in terms of now()), and because it has been a while since the last release and nobody has missed it.
Subject: DateTime-Calendar-Christian.patch
--- lib/DateTime/Calendar/Christian.old 2003-07-27 22:01:28.000000000 -0400 +++ lib/DateTime/Calendar/Christian.pm 2016-08-16 10:07:17.000000000 -0400 @@ -182,6 +182,8 @@ sub now { shift->from_epoch( epoch => (scalar time), @_ ) } +sub today { shift->now(@_)->truncate( to => 'day' ) } + sub from_object { my $class = shift; my %args = @_;