diff options
Diffstat (limited to 'Plugin/Timezone.pm')
-rw-r--r-- | Plugin/Timezone.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Plugin/Timezone.pm b/Plugin/Timezone.pm index 594c5d7..eb953a1 100644 --- a/Plugin/Timezone.pm +++ b/Plugin/Timezone.pm @@ -23,15 +23,16 @@ sub configure { sub time { my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_; - my $requester = ( split /!/, $who)[0]; + my $requester = (split /!/, $who)[0]; my @known_zones = (keys %{$config{timezone}}); return "Syntax: time [nick]" unless @arguments == 1; my $nick = $arguments[0]; - if (grep {$_ eq $nick} @known_zones) { + my ($case_nick) = grep {/^$nick$/i} @known_zones; + if ($case_nick) { my $d = DateTime->now(); - $d->set_time_zone($config{timezone}->{$nick}); + $d->set_time_zone($config{timezone}->{$case_nick}); my $timestr = $d->strftime("%Y-%m-%d %H:%M %Z"); return "$requester: $nick\'s clock reads $timestr"; } else { |