Skip to content

Instantly share code, notes, and snippets.

@ss23
Created January 28, 2014 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ss23/8678881 to your computer and use it in GitHub Desktop.
Save ss23/8678881 to your computer and use it in GitHub Desktop.
<?php
$EmbargoDateField = new DatetimeField('EmbargoDate', 'Embargo Date (this will change Status to Published)');
$EmbargoDateField->getDateField()->setConfig('showcalendar', 1);
$EmbargoDateField->getTimeField()->setConfig('timeformat', 'H:mm');
// Works
$ExpiryDateField = new DatetimeField('ExpiryDate', 'Expiry Date (this will change Status to Draft)');
$ExpiryDateField->getDateField()->setConfig('showcalendar', 1);
$ExpiryDateField->getTimeField()->setConfig('timeformat', 'H:mm');
// Works
$publicDate = ($this->PublicDate) ? $this->PublicDate : array('date' => date('d/m/Y', strtotime('+1 weeks')), 'time' => date('H:i'));
$PublicDateField = new DatetimeField('PublicDateFake', 'Become public access', $publicDate);
$PublicDateField->getDateField()->setConfig('showcalendar', 1);
$PublicDateField->getTimeField()->setConfig('timeformat', 'H:mm');
// DOESN'T WORK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment