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 = @_;