- 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

@ -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;
}
#-------------------------------------------------------------------