add check for duration 00:00

This commit is contained in:
naomiaro 2011-01-30 21:47:59 -05:00
parent 556292e623
commit c87e1fb257
1 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
'filters' => array('StringTrim'),
'validators' => array(
'NotEmpty',
array('regex', false, array('([0-2][0-3]:[0-5][0-5])', 'messages' => 'Show must be under 24 hours'))
array('date', false, array('HH:mm', 'messages' => 'Show must be under 24 hours'))
)
));
@ -64,8 +64,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$valid = false;
}
if(strtotime("23:59") < strtotime($formData["add_show_duration"])) {
$this->getElement('add_show_duration')->setErrors(array('Max show size: 23:59'));
if(strtotime("00:00") == strtotime($formData["add_show_duration"])) {
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00:00'));
$valid = false;
}