From 62a8c523a0b172768a58726558cdb907785da91d Mon Sep 17 00:00:00 2001 From: Tom Browder Date: Thu, 22 Feb 2024 10:34:24 -0600 Subject: [PATCH] prep for next release --- Changes | 1 + docs/README.rakudoc | 23 ++++++++++++----------- lib/DateTime/Subs.rakumod | 7 ++++++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Changes b/Changes index 4c053e3..45f1518 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for DateTime-US {{$NEXT}} + - Add sub get-dst-dates-datehash 0.1.4 2024-02-21T19:16:34-06:00 - Use LocalTime to add correct suffix to local time output diff --git a/docs/README.rakudoc b/docs/README.rakudoc index cfb221b..bff8e41 100644 --- a/docs/README.rakudoc +++ b/docs/README.rakudoc @@ -2,7 +2,7 @@ =head1 NAME -B - Provides time zone (TZ) and Daylight Saving Time (DST) +B - Provides time zone (TZ) and Daylight Saving Time (DST) information for US states and territories =head1 SYNOPSIS @@ -14,12 +14,12 @@ use DateTime::Subs; # part of the 'DateTime::US' distribution =head1 DESCRIPTION -Module B provides a class with methods used to help Raku -programs needing US time zone and DST information. The user creates a -C object by providing a US time zone abbreviation (note the -TZ input abbreviation may be in either format for standard or daylight -saving time, e.g., 'CST' or 'CDT'). The list of known data may be -listed without an object: +Module B provides a class with methods used to help Raku +programs needing US time zone and DST information. The user creates a +C object by providing a US time zone abbreviation (note +the TZ input abbreviation may be in either format for standard or +daylight saving time, e.g., 'CST' or 'CDT'). The list of known data +may be listed without an object: =begin code $ raku @@ -27,9 +27,10 @@ $ raku > show-us-data; =end code -The main use case that motivated the module is to convert time in UTC to local -time for creating calendars and almanacs. For example, local Sunrise is -given in UTC and will normally be shown on a calendar in local time: +The main use case that motivated the module is to convert time in UTC +to local time for creating calendars and almanacs. For example, local +Sunrise is given in UTC and will normally be shown on a calendar in +local time: =begin code my $tz = DateTime::US.new: :timezone; @@ -71,7 +72,7 @@ The C<:$year> argument defaults to the current year if it is not provided. The final routine is for use by module C. The C<:$set-id> argument is used to provide a globally unique ID (GUID) -to allow multiple C objects for a C in a C keyed +to allow multiple C objects for a C in a C keyed by Cs. =item get-dst-dates(:$year!, :$set-id! --> Hash) is export(:get-dst-date) {...} diff --git a/lib/DateTime/Subs.rakumod b/lib/DateTime/Subs.rakumod index 1685419..c382e99 100644 --- a/lib/DateTime/Subs.rakumod +++ b/lib/DateTime/Subs.rakumod @@ -27,7 +27,12 @@ sub dst-end(:$year is copy --> Date) is export(:dst-end) { $d } -sub get-dst-dates(:$year!, :$set-id! --> Hash) is export(:get-dst-date) { +sub get-dst-dates-datehash(:$year!, --> Hash) is export(:get-dst-dates-datehash) { + my $b = dst-begin :$year; + my $e = dst-end :$year; +} + +sub get-dst-dates(:$year!, :$set-id! --> Hash) is export(:get-dst-dates) { my $b = dst-begin :$year; my $e = dst-end :$year; my %dst;