Changeset 360

Show
Ignore:
Timestamp:
03/22/07 12:01:48 (20 months ago)
Author:
ogawa
Message:

Update version number. And treat more pricisely the UNTIL date.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • WWW-CybozuOffice6-Calendar/trunk/lib/WWW/CybozuOffice6/Calendar.pm

    r356 r360  
    1010use Text::CSV_XS; 
    1111 
    12 our $VERSION = '0.01'; 
     12our $VERSION = '0.02'; 
    1313 
    1414sub new { 
     
    110110 
    111111# handle recurrent events 
     112our %FREQUENCY = ( y => 'YEARLY', m => 'MONTHLY', w => 'WEEKLY', 
     113                   d => 'DAILY', n => 'WEEKDAYS' ); 
    112114sub _parse_recurrent_event { 
    113115    my $this = shift; 
     
    121123 
    122124    # frequency 
    123     my %FREQUENCY = ( y => 'YEARLY', m => 'MONTHLY', w => 'WEEKLY', 
    124                       d => 'DAILY', n => 'WEEKDAYS' ); 
    125125    my $freq = $fields[7]; 
    126     if (exists $FREQUENCY{$freq}) { 
     126    if ($freq && exists $FREQUENCY{$freq}) { 
    127127        $item->{frequency} = $FREQUENCY{$freq}; 
    128128        $item->{frequency_value} = $fields[8] || 0; 
    129         $item->{until} = $this->to_datetime($fields[4]) 
    130             if $fields[4] ne '//'; 
     129        if ($fields[4] =~ m!^(\d+)/(\d+)/(\d+)$!) { 
     130            my %args = (year => $1, month => $2, day => $3); 
     131            my $until; 
     132            if ($item->{is_full_day}) { 
     133                $until = $this->to_datetime($fields[4], ':'); 
     134            } else { 
     135                $until = $item->{end}->clone->set(%args); 
     136                $until->set_time_zone('UTC'); # timezone must be UTC 
     137            } 
     138            $item->{until} = $until; 
     139        } 
    131140    } 
    132141