Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version #6

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 12 additions & 11 deletions docs/README.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

=head1 NAME

B<DateTime::US> - Provides time zone (TZ) and Daylight Saving Time (DST)
B<DateTime::US> - Provides time zone (TZ) and Daylight Saving Time (DST)
information for US states and territories

=head1 SYNOPSIS
Expand All @@ -14,22 +14,23 @@ use DateTime::Subs; # part of the 'DateTime::US' distribution

=head1 DESCRIPTION

Module B<DateTime::US> provides a class with methods used to help Raku
programs needing US time zone and DST information. The user creates a
C<DateTime::US> 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<DateTime::US> provides a class with methods used to help Raku
programs needing US time zone and DST information. The user creates a
C<DateTime::US> 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
> use DateTime::US;
> 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<CST>;
Expand Down Expand Up @@ -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<Date::Event>.
The C<:$set-id> argument is used to provide a globally unique ID (GUID)
to allow multiple C<Date::Event> objects for a C<Date> in a C<Hash> keyed
to allow multiple C<Date::Event> objects for a C<Date> in a C<Hash> keyed
by C<Date>s.

=item get-dst-dates(:$year!, :$set-id! --> Hash) is export(:get-dst-date) {...}
Expand Down
7 changes: 6 additions & 1 deletion lib/DateTime/Subs.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading