Changeset 518 for cybozu2ical/trunk/lib/WWW/CybozuOffice6/Calendar/Event.pm
- Timestamp:
- 09/01/08 19:33:58 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
cybozu2ical/trunk/lib/WWW/CybozuOffice6/Calendar/Event.pm
r505 r518 19 19 20 20 __PACKAGE__->mk_accessors( 21 qw( id start end summary description created modified is_full_day comment )21 qw( id start end summary description created time_zone modified is_full_day comment ) 22 22 ); 23 23 … … 25 25 my ( $this, %param ) = @_; 26 26 27 $this-> {id} = $param{id} || '0';28 $this-> {time_zone} = $param{time_zone} || 'Asia/Tokyo';27 $this->id( $param{id} || '0' ); 28 $this->time_zone( $param{time_zone} || 'Asia/Tokyo' ); 29 29 30 my $start = $this->to_datetime( $param{s tart_date}, $param{start_time} );31 my $end = $this->to_datetime( $param{end_date}, $param{end_time} );30 my $start = $this->to_datetime( $param{set_date}, $param{set_time} ); 31 my $end = $this->to_datetime( $param{end_date}, $param{end_time} ); 32 32 return unless $start && $end; 33 33 34 # (s tart_time == empty) => A full-day event35 # (s tart_time != empty) && (end_time == empty) => A malformed event36 if ( $param{s tart_time} eq ':' ) {34 # (set_time == empty) => A full-day event 35 # (set_time != empty) && (end_time == empty) => A malformed event 36 if ( $param{set_time} eq ':' ) { 37 37 $start = $start->truncate( to => 'day' ); 38 38 $end = $end->add( days => 1 )->truncate( to => 'day' ); 39 $this-> {is_full_day} = 1;39 $this->is_full_day(1); 40 40 } 41 41 elsif ( $param{end_time} eq ':' ) { 42 42 $end = $start->clone->add( minutes => 10 ); 43 43 } 44 $this-> {start} = $start;45 $this-> {end} = $end;44 $this->start($start); 45 $this->end($end); 46 46 47 $this->{created} = DateTime->from_epoch( epoch => $param{created} || 0 ); 47 $param{timestamp} =~ s/^ts\.//; # remove rubbish 48 $this->created( DateTime->from_epoch( epoch => $param{timestamp} || 0 ) ); 48 49 49 50 my $summary = 50 ( $param{ abbrev} ? $param{abbrev} . ': ' : '' ) . $param{summary};51 $this-> {summary} = $summary;52 $this-> {description} = $param{description} || $summary;51 ( $param{event} ? $param{event} . ': ' : '' ) . $param{detail}; 52 $this->summary($summary); 53 $this->description( $param{memo} || $summary ); 53 54 1; 54 55 } … … 75 76 } 76 77 77 $args{time_zone} = $this-> {time_zone};78 $args{time_zone} = $this->time_zone; 78 79 79 80 DateTime->new(%args);
![(please configure the [header_logo] section in trac.ini)](/public/chrome/common/trac_banner.png)