Show
Ignore:
Timestamp:
04/03/08 08:14:20 (20 months ago)
Author:
fumiakiy
Message:

Implemented MT::DateTime::compare. BugId:67917

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-33/lib/MT/AtomServer.pm

    r1174 r1744  
    557557    if (my $iso = $atom->issued) { 
    558558        my $pub_ts = MT::Util::iso2ts($blog, $iso); 
    559         my @ts = MT::Util::offset_time_list(time, $blog->id); 
    560         my $ts = sprintf '%04d%02d%02d%02d%02d%02d', 
    561             $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]; 
    562559        $entry->authored_on($pub_ts); 
    563         if ($pub_ts > $ts) { 
     560        if ( 0 < MT::DateTime->compare( blog => $blog, 
     561                a => $pub_ts, 
     562                b => { value => time(), type => 'epoch' } ) 
     563           ) 
     564        { 
    564565            $entry->status(MT::Entry::FUTURE()) 
    565566        } 
     
    647648    if (my $iso = $atom->issued) { 
    648649        my $pub_ts = MT::Util::iso2ts($blog, $iso); 
    649         my @ts = MT::Util::offset_time_list(time, $blog->id); 
    650         my $ts = sprintf '%04d%02d%02d%02d%02d%02d', 
    651             $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]; 
    652650        $entry->authored_on($pub_ts); 
    653         if ($pub_ts > $ts) { 
     651        if ( 0 < MT::DateTime->compare( blog => $blog, 
     652                a => $pub_ts, 
     653                b => { value => time(), type => 'epoch' } ) 
     654           ) 
     655        { 
    654656            $entry->status(MT::Entry::FUTURE()) 
    655657        }