diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 4bcdce010..512ffd0ca 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,5 +1,9 @@ 6.7.6 -- fix [ 1302878 ] testEnvironment.pl does not check versions (Wouter van Oijen / ProcoliX) + - Fixed a bug in setToEpoch that caused dates to be improperly formatted. + - Fixed a problem with the slide panel where the links would sometimes take + the properties of the style. + - fix [ 1302878 ] testEnvironment.pl does not check versions (Wouter van Oijen / ProcoliX) + 6.7.5 - Fixed a syntax error in Syndicated Content. diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 8a863dd7c..0d5b31f11 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,5 +1,5 @@ package WebGUI; -our $VERSION = "6.7.5"; +our $VERSION = "6.7.6"; our $STATUS = "gamma"; #------------------------------------------------------------------- diff --git a/lib/WebGUI/DateTime.pm b/lib/WebGUI/DateTime.pm index c6663a34e..d1b068348 100644 --- a/lib/WebGUI/DateTime.pm +++ b/lib/WebGUI/DateTime.pm @@ -744,20 +744,16 @@ A string in the format of YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. =cut sub setToEpoch { - my $set = shift; - # in epochToSet we use epochToHuman, which includes the time - # offset of the user, so we need to remove that here. - my $offset = $session{user}{timeOffset} || 0; - $set -= $offset*3600; - my @now = epochToArray(WebGUI::DateTime::time()); - my ($date,$time) = split(/ /,$set); - my ($year, $month, $day) = split(/\-/,$date); - my ($hour, $minute, $second) = split(/\:/,$time); - if (int($year) < 3000 && int($year) > 1000) { - $year = int($year); - } else { - $year = $now[0]; - } + my $set = shift; + my @now = epochToArray(WebGUI::DateTime::time()); + my ($date,$time) = split(/ /,$set); + my ($year, $month, $day) = split(/\-/,$date); + my ($hour, $minute, $second) = split(/\:/,$time); + if (int($year) < 3000 && int($year) > 1000) { + $year = int($year); + } else { + $year = $now[0]; + } if (int($month) < 13 && int($month) > 0) { $month = int($month); } else { @@ -768,7 +764,12 @@ sub setToEpoch { } else { $day = $now[2]; } - return arrayToEpoch($year,$month,$day,$hour,$minute,$second); + my $epoch = arrayToEpoch($year,$month,$day,$hour,$minute,$second); + # in epochToSet we use epochToHuman, which includes the time + # offset of the user, so we need to remove that here. + my $offset = $session{user}{timeOffset} || 0; + $epoch -= $offset*3600; + return $epoch; } #-------------------------------------------------------------------