-
-
Save zoffixznet/6f3add4b642dbf37eb45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
method irc-connected ($irc) { | |
my $utc-hny = utc-hny; | |
$irc.debug and say "UTC HNY is $utc-hny"; | |
my @offsets = get-tzs; | |
my $prev-offset = now + 10; | |
for get-tzs() -> $tz { | |
my $cur-offset = $utc-hny.Instant + $tz<offset>*3600; | |
next if $cur-offset - now <= 0; | |
say "Starting prev {$cur-offset - $prev-offset}"; | |
Promise.at( $prev-offset ).then: { | |
say "Making Nex New Year announcemnet: {$cur-offset - $prev-offset}"; | |
my $x = $cur-offset - $prev-offset; | |
announce-hny $irc, $tz, | |
:next-new-year($x ), | |
:$!short-announcement-at; | |
}; | |
say "Starting cur {DateTime.new: $cur-offset}"; | |
Promise.at( $cur-offset ).then: { | |
announce-hny $irc, $tz, :$!short-announcement-at; | |
}; | |
$prev-offset = $cur-offset; | |
} | |
# say denominate $utc-hny.Instant - (DateTime.now.utc.Instant + (-5*3600) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment