fix: Calendar Update Feeds Activity now handles iCalendar "DURATION" field

fix: Various potential bugs in WebGUI::DateTime due to inheritence from DateTime
This commit is contained in:
Doug Bell 2007-02-14 23:13:40 +00:00
parent 7a695188a3
commit d29de5f7f9
3 changed files with 134 additions and 10 deletions

View file

@ -127,14 +127,14 @@ sub new
my $locale = 'en_US';
my $session;
if(ref $param0 eq "WebGUI::Session") {
if (ref $param0 eq "WebGUI::Session") {
$session = shift;
my $i18n = WebGUI::International->new($session);
my $language = $i18n->getLanguage($session->user->profileField('language'));
$locale = $language->{languageAbbreviation} || 'en';
$locale .= "_".$language->{locale} if ($language->{locale});
}
#use Data::Dumper;
#warn "Args to DateTime->new: ".Dumper \@_;
@ -236,6 +236,28 @@ sub from_object {
#######################################################################
=head2 set
Handle copying all WebGUI::DateTime specific data. This is an object method.
This method overrides the set in DateTime to keep WebGUI::DateTime specific
information being passed between object instances. Some DateTime operations
create a new object.
=cut
sub set {
my $self = shift;
my $session = $self->session;
my $copy = $self->SUPER::set(@_);
$copy->session($session);
return $copy;
}
#######################################################################
=head2 toDatabase
Returns a MySQL Date/Time string in the UTC time zone
@ -419,6 +441,52 @@ sub toUserTimeZoneTime {
return $copy->strftime($MYSQL_TIME);
}
#######################################################################
=head2 truncate
Handle copying all WebGUI::DateTime specific data. This is an object method.
This method overrides the set in DateTime to keep WebGUI::DateTime specific
information being passed between object instances. Some DateTime operations
create a new object.
=cut
sub truncate {
my $self = shift;
my $session = $self->session;
my $copy = $self->SUPER::truncate(@_);
$copy->session($session);
return $copy;
}
#######################################################################
=head2 set
Handle copying all WebGUI::DateTime specific data. This is an object method.
This method overrides the set in DateTime to keep WebGUI::DateTime specific
information being passed between object instances. Some DateTime operations
create a new object.
=cut
sub set {
my $self = shift;
my $session = $self->session;
my $copy = $self->SUPER::set(@_);
$copy->session($session);
return $copy;
}
#######################################################################
=head2 session