Added getDayOfWeek function which returns the numeric day of the week (1=Monday, 2=Tuesday, etc)

This commit is contained in:
Frank Dillon 2006-05-01 21:17:53 +00:00
parent 4decfcd738
commit 92626f43af

View file

@ -357,6 +357,26 @@ sub getDayName {
}
}
#-------------------------------------------------------------------
=head2 getDayOfWeek ( epoch) {
Returns the position (1 - 7) of the day of the week of the epoch passed in. 1 is Monday, 2 is Tuesday, etc
=head3 epoch
An epoch date.
=cut
sub getDayOfWeek {
my $self = shift;
my $dt = DateTime->from_epoch( epoch => shift );
$dt->set_time_zone($self->session->user->profileField("timeZone")|| "America/Chicago"); # assign the user's timezone
return $dt->day_of_week;
}
#-------------------------------------------------------------------
=head2 getDaysInMonth ( epoch )