cc-2683: not using utc time

-date/time values are converted to UTC before storing in database
 on show create
-cleanup
This commit is contained in:
martin 2011-08-15 14:22:33 -04:00
parent 4f2b2dba6d
commit 6ee3d2f5e0
2 changed files with 31 additions and 45 deletions

View file

@ -88,18 +88,16 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
}
public function checkReliantFields($formData, $startDateModified) {
$valid = true;
$now_timestamp = date("Y-m-d H:i:s");
$start_timestamp = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
$now_epoch = strtotime($now_timestamp);
$start_epoch = strtotime($start_timestamp);
$start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
//DateTime stores $start_time in the current timezone
$nowDateTime = new DateTime();
$showStartDateTime = new DateTime($start_time);
if ((($formData['add_show_id'] != -1) && $startDateModified) || ($formData['add_show_id'] == -1)){
if($start_epoch < $now_epoch) {
if($showStartDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
$this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
$valid = false;
}
@ -118,6 +116,5 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
return $valid;
}
}