Merge pull request #366 from quovadit/CalendarToday

CalendarToday: use correct timezone
master
Jag Talon 2014-03-23 16:00:42 -04:00
commit f5e45ffa1e
1 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,8 @@ package DDG::Goodie::CalendarToday;
use DDG::Goodie;
use Time::Piece;
use DateTime;
use DateTime::TimeZone;
primary_example_queries "calendar";
secondary_example_queries "calendar november",
@ -36,8 +38,9 @@ my $css = share("style.css")->slurp;
handle remainder => sub {
# check current date
my $t = localtime;
# check current date in users timezone
my $t = DateTime->now;
$t->set_time_zone($loc->time_zone);
$currentDay = $t->mday;
$currentMonth = $t->mon;
$currentYear = $t->year;