Last tuesday, I have released a new Raku module,
Date::Calendar::Gregorian.

This is not because I distrust the core class Date or because I do not
like it. On the contrary. D::C::Gregorian is a child class to the
core class Date.

The core class is fine with number crunching and date computing.
But it is lacks some functionalities when you are interested in
strings, especially day names and month names. If you use
TBROWDER's Date::Names, the two modules can work together,
but not very nicely. And while you can add my module
Date::Calendar::Strftime, you cannot use it fully (no "%A"
specifiers for day names, no "%B" specifiers for month
names). Here is the example from the synopsis:

use Date::Names;
use Date::Calendar::Strftime;

my Date $date .= new('2020-04-05');
my Date::Names $locale .= new(lang => 'fr');

my $day = $locale.dow($date.day-of-week);
my $month = $locale.mon($date.month);
$date does Date::Calendar::Strftime;

say $date.strftime("$day %d $month %Y");
# --> dimanche 05 avril 2020

Now, my module Date::Calendar::Gregorian provides the
glue to merge together Date, Date::Names and
Date::Calendar::Strftime and streamline your code.
Here is the other example from the synopsis:

use Date::Calendar::Gregorian;
my Date::Calendar::Gregorian $date .= new('2020-04-05',
locale => 'fr');
say $date.strftime("%A %d %B %Y");
# --> dimanche 05 avril 2020

A side note: this is the fourth attempt to send the message to the
DateTime mailing-list. I have tried yesterday morning, yesterday
evening and this morning. These messages did not appear in the list websites
http://nntp.perl.org/group/perl.datetime
https://www.mail-archive.com/datetime@perl.org/
and I did not receive it in my inbox.
So I try again, until I receive my message in my inbox and until
they appear in the list websites. Please excuse me if you have
received the first or the second message.


Thank you for your attention,

Jean Forget
JFORGET at cpan dot org 

Reply via email to