aboutsummaryrefslogtreecommitdiff
path: root/Plugin
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-08-01 12:06:36 +1200
committerDavid Phillips <david@sighup.nz>2018-08-01 12:06:46 +1200
commite59093be7619f969c9e935d3de539e7432286942 (patch)
tree44cf9d0f3af177d430da20ce2d7795070ccc2300 /Plugin
parent6074ece09644f477452930dba104790921b81e94 (diff)
downloadidalius-e59093be7619f969c9e935d3de539e7432286942.tar.xz
Timezone: Implement case insensitivity
Merges GitHub #14
Diffstat (limited to 'Plugin')
-rw-r--r--Plugin/Timezone.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Plugin/Timezone.pm b/Plugin/Timezone.pm
index 6dcd0c0..a536ed6 100644
--- a/Plugin/Timezone.pm
+++ b/Plugin/Timezone.pm
@@ -29,9 +29,10 @@ sub time {
return "Syntax: time [nick]" unless @arguments == 1;
my $nick = $arguments[0];
- if (grep {$_ =~ /^$nick$/i} @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 {