- 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.
This commit is contained in:
JT Smith 2005-09-24 14:54:20 +00:00
parent d23e580115
commit 842eb4a331
3 changed files with 22 additions and 17 deletions

View file

@ -1,5 +1,9 @@
6.7.6 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 6.7.5
- Fixed a syntax error in Syndicated Content. - Fixed a syntax error in Syndicated Content.

View file

@ -1,5 +1,5 @@
package WebGUI; package WebGUI;
our $VERSION = "6.7.5"; our $VERSION = "6.7.6";
our $STATUS = "gamma"; our $STATUS = "gamma";
#------------------------------------------------------------------- #-------------------------------------------------------------------

View file

@ -744,20 +744,16 @@ A string in the format of YYYY-MM-DD or YYYY-MM-DD HH:MM:SS.
=cut =cut
sub setToEpoch { sub setToEpoch {
my $set = shift; my $set = shift;
# in epochToSet we use epochToHuman, which includes the time my @now = epochToArray(WebGUI::DateTime::time());
# offset of the user, so we need to remove that here. my ($date,$time) = split(/ /,$set);
my $offset = $session{user}{timeOffset} || 0; my ($year, $month, $day) = split(/\-/,$date);
$set -= $offset*3600; my ($hour, $minute, $second) = split(/\:/,$time);
my @now = epochToArray(WebGUI::DateTime::time()); if (int($year) < 3000 && int($year) > 1000) {
my ($date,$time) = split(/ /,$set); $year = int($year);
my ($year, $month, $day) = split(/\-/,$date); } else {
my ($hour, $minute, $second) = split(/\:/,$time); $year = $now[0];
if (int($year) < 3000 && int($year) > 1000) { }
$year = int($year);
} else {
$year = $now[0];
}
if (int($month) < 13 && int($month) > 0) { if (int($month) < 13 && int($month) > 0) {
$month = int($month); $month = int($month);
} else { } else {
@ -768,7 +764,12 @@ sub setToEpoch {
} else { } else {
$day = $now[2]; $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;
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------