-
-
Save fdob/4118781 to your computer and use it in GitHub Desktop.
Stack Trace Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$content = $this->api->getContentToUpdate( | |
$this->api->getContentInfoByPath( '/Date-and-Time-Test-Object' ) | |
); | |
try { | |
$newData = new DateTime( '31-09-2012 12:00 am' ); // 31-09-2012 12:00 am | |
$content->setField( 'date_time', $newData ); | |
$this->api->saveContentUpdate( $content ); | |
} catch (exception $e) { | |
echo "Exception trying to add and invalid date and time \n"; | |
$newData = new DateTime( '30-09-2012 12:00 am' ); // 31-09-2012 12:00 am | |
$content->setField( 'date_time', $newData ); | |
$this->api->saveContentUpdate( $content ); | |
} | |
$this->api->clearViewCacheByPath( '/' ); // Workaround for bug #019637 : publicAPI : View cache is not cleared when making a new version of an object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment