Fixed timezone problem in dayStartEnd routine
Fixed documentation
This commit is contained in:
parent
14cf8adf0a
commit
be219b7654
1 changed files with 12 additions and 10 deletions
|
|
@ -42,12 +42,12 @@ This package provides easy to use date math functions, which are normally a comp
|
||||||
$dt = WebGUI::Session::DateTime->new($session);
|
$dt = WebGUI::Session::DateTime->new($session);
|
||||||
$session = $dt->session;
|
$session = $dt->session;
|
||||||
|
|
||||||
$epoch = $dt-$self->session->datetime->addToDate($epoch, $years, $months, $days);
|
$epoch = $dt->addToDate($epoch, $years, $months, $days);
|
||||||
$epoch = $dt-$self->session->datetime->addToTime($epoch, $hours, $minutes, $seconds);
|
$epoch = $dt->addToTime($epoch, $hours, $minutes, $seconds);
|
||||||
$epoch = $dt-$self->session->datetime->addToDateTime($epoch, $years, $months, $days, $hours, $minutes, $seconds);
|
$epoch = $dt->addToDateTime($epoch, $years, $months, $days, $hours, $minutes, $seconds);
|
||||||
($startEpoch, $endEpoch) = $dt->dayStartEnd($epoch);
|
($startEpoch, $endEpoch) = $dt->dayStartEnd($epoch);
|
||||||
$dateString = $dt-$self->session->datetime->epochToHuman($epoch, $formatString);
|
$dateString = $dt->epochToHuman($epoch, $formatString);
|
||||||
$setString = $dt-$self->session->datetime->epochToSet($epoch);
|
$setString = $dt->epochToSet($epoch);
|
||||||
$day = $dt->getDayName($dayInteger);
|
$day = $dt->getDayName($dayInteger);
|
||||||
$integer = $dt->getDaysInMonth($epoch);
|
$integer = $dt->getDaysInMonth($epoch);
|
||||||
$integer = $dt->getDaysInInterval($start, $end);
|
$integer = $dt->getDaysInInterval($start, $end);
|
||||||
|
|
@ -57,14 +57,14 @@ This package provides easy to use date math functions, which are normally a comp
|
||||||
$month = $dt->getMonthName($monthInteger);
|
$month = $dt->getMonthName($monthInteger);
|
||||||
$seconds = $dt->getSecondsFromEpoch($seconds);
|
$seconds = $dt->getSecondsFromEpoch($seconds);
|
||||||
$zones = $dt->getTimeZones();
|
$zones = $dt->getTimeZones();
|
||||||
$epoch = $dt-$self->session->datetime->humanToEpoch($dateString);
|
$epoch = $dt->humanToEpoch($dateString);
|
||||||
$seconds = $dt->intervalToSeconds($interval, $units);
|
$seconds = $dt->intervalToSeconds($interval, $units);
|
||||||
@date = $dt-$self->session->datetime->loca$self->session->datetime->time($epoch);
|
@date = $dt->time($epoch);
|
||||||
($startEpoch, $endEpoch) = $dt-$self->session->datetime->monthStartEnd($epoch);
|
($startEpoch, $endEpoch) = $dt->monthStartEnd($epoch);
|
||||||
($interval, $units) = $dt->secondsToInterval($seconds);
|
($interval, $units) = $dt->secondsToInterval($seconds);
|
||||||
$timeString = $dt->secondsToTime($seconds);
|
$timeString = $dt->secondsToTime($seconds);
|
||||||
$epoch = $dt-$self->session->datetime->setToEpoch($setString);
|
$epoch = $dt->setToEpoch($setString);
|
||||||
$epoch = $dt-$self->time();
|
$epoch = $dt->time();
|
||||||
$seconds = $dt->timeToSeconds($timeString);
|
$seconds = $dt->timeToSeconds($timeString);
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
@ -215,6 +215,8 @@ sub dayStartEnd {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $dt = DateTime->from_epoch( epoch => shift);
|
my $dt = DateTime->from_epoch( epoch => shift);
|
||||||
my $end = $dt->clone;
|
my $end = $dt->clone;
|
||||||
|
$dt->set_time_zone($self->session->user->profileField("timeZone")|| "America/Chicago"); # assign the user's timezone
|
||||||
|
$end->set_time_zone($self->session->user->profileField("timeZone")|| "America/Chicago"); # assign the user's timezone
|
||||||
$dt->set_hour(0);
|
$dt->set_hour(0);
|
||||||
$dt->set_minute(0);
|
$dt->set_minute(0);
|
||||||
$dt->set_second(0);
|
$dt->set_second(0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue