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/XMLRPCServer.pm

    r1724 r1744  
    361361        $entry->authored_on(MT::XMLRPCServer::Util::iso2ts($blog, $iso)) 
    362362            || die MT::XMLRPCServer::_fault(MT->translate("Invalid timestamp format")); 
    363         my @ts = MT::Util::offset_time_list(time, $blog_id); 
    364         my $ts = sprintf '%04d%02d%02d%02d%02d%02d', 
    365             $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]; 
     363        require MT::DateTime; 
    366364        $entry->status(MT::Entry::FUTURE()) 
    367             if ($entry->authored_on > $ts); 
     365            if MT::DateTime->compare( 
     366                blog => $blog, 
     367                a => $entry->authored_on, 
     368                b => { value => time(), type => 'epoch' } ) > 0; 
    368369    } 
    369370    $entry->discover_tb_from_entry(); 
     
    487488        $entry->authored_on(MT::XMLRPCServer::Util::iso2ts($entry->blog_id, $iso)) 
    488489           || die MT::XMLRPCServer::_fault(MT->translate("Invalid timestamp format")); 
     490        require MT::DateTime; 
     491        $entry->status(MT::Entry::FUTURE()) 
     492            if MT::DateTime->compare( 
     493                a => $entry->authored_on, 
     494                b => { value => time(), type => 'epoch' } ) > 0; 
    489495    } 
    490496    $entry->discover_tb_from_entry();