From 696b66a8cbc7ba8993ddf76bfa9ca83f36451241 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Tue, 11 Oct 2011 13:55:16 +0200 Subject: Timeformat bei add und edit event nun auf 12h format --- application/controllers/EventController.php | 8 +++---- application/forms/EventAdd.php | 24 ++++++++++++++----- application/forms/EventEdit.php | 36 ++++++++++++++++++++--------- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php index 8c96327..820ad66 100755 --- a/application/controllers/EventController.php +++ b/application/controllers/EventController.php @@ -148,14 +148,14 @@ class EventController extends Zend_Controller_Action $repeattypelist = $repeattypeMapper->fetchAll(); $add = $this->getRequest()->getParam("add"); if($this->getRequest()->getParam('start')) { - $start = date ('m/d/Y H:i', strtotime($this->getRequest()->getParam('start'))); + $start = date ('m/d/Y H:i a', strtotime($this->getRequest()->getParam('start'))); } else if($this->getRequest()->getParam('evstart')) { - $start = date ('m/d/Y H:i', strtotime(substr($this->getRequest()->getParam('evstart'), 0, 24))); + $start = date ('m/d/Y H:i a', strtotime(substr($this->getRequest()->getParam('evstart'), 0, 24))); } else {$start = 'mm/dd/yyyy H:min';} if($this->getRequest()->getParam('end')) { - $end = date ('m/d/Y H:i', strtotime($this->getRequest()->getParam('end'))); + $end = date ('m/d/Y H:i a', strtotime($this->getRequest()->getParam('end'))); } else if($this->getRequest()->getParam('evend')) { - $end = date ('m/d/Y H:i', strtotime(substr($this->getRequest()->getParam('evend'), 0, 24))); + $end = date ('m/d/Y H:i a', strtotime(substr($this->getRequest()->getParam('evend'), 0, 24))); } else {$end = 'mm/dd/yyyy H:min';} if (!isset($add)){ $defaultEventCategory = $this->config['event']['category']['default']; diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php index 49c7e87..7f43e9a 100755 --- a/application/forms/EventAdd.php +++ b/application/forms/EventAdd.php @@ -173,7 +173,7 @@ class Application_Form_EventAdd extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), - array('Date', false, array('format' => 'mm/dd/yyyy H:i')), + array('Date', false, array('format' => 'mm/dd/yyyy H:i a')), ), 'required' => true, 'label' => 'Start:', @@ -184,7 +184,7 @@ class Application_Form_EventAdd extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), - array('Date', false, array('format' => 'mm/dd/yyyy H:i')), + array('Date', false, array('format' => 'mm/dd/yyyy H:i a')), array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())), ), 'required' => false, @@ -236,7 +236,7 @@ class Application_Form_EventAdd extends Zend_Form ), 'required' => false, 'label' => 'Repeat End Date:', - 'value' => 'mm/dd/yyyy H:min', + 'value' => 'mm/dd/yyyy H:min am/pm', )); $this->addElement('text', 'repeatings', array( @@ -326,9 +326,21 @@ class Application_Form_EventAdd extends Zend_Form immediateChanged("immediate"); bootosfieldChanged("pbs_bootosID", ' . count($this->bootoslist) . '); $(function() { - $("#start").datetimepicker(); - $("#end").datetimepicker(); - $("#repeatdate").datetimepicker(); + $("#start").datetimepicker({ + dateFormat: "mm/dd/yy", + timeFormat: "hh:mm tt", + ampm: true + }); + $("#end").datetimepicker({ + dateFormat: "mm/dd/yy", + timeFormat: "hh:mm tt", + ampm: true + }); + $("#repeatdate").datetimepicker({ + dateFormat: "mm/dd/yy", + timeFormat: "hh:mm tt", + ampm: true + }); }); '; } diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php index a2b5eba..e9a5bf4 100755 --- a/application/forms/EventEdit.php +++ b/application/forms/EventEdit.php @@ -132,11 +132,11 @@ class Application_Form_EventEdit extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), - array('Date', false, array('format' => 'mm/dd/yyyy H:i')), + array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), ), 'required' => true, 'label' => 'Start:', - 'value' => date ('m/d/Y H:i', strtotime( $this->params['start'])), + 'value' => date ('m/d/Y h:i a', strtotime( $this->params['start'])), )); if(isset($this->params['end'])) { @@ -144,12 +144,12 @@ class Application_Form_EventEdit extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), - array('Date', false, array('format' => 'mm/dd/yyyy H:i')), + array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())), ), 'required' => false, 'label' => 'End:', - 'value' => date ('m/d/Y H:i', strtotime( $this->params['end'])), + 'value' => date ('m/d/Y h:i a', strtotime( $this->params['end'])), )); $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate'); } else { @@ -157,12 +157,12 @@ class Application_Form_EventEdit extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), - array('Date', false, array('format' => 'mm/dd/yyyy H:i')), + array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())), ), 'required' => false, 'label' => 'End:', - 'value' => 'mm/dd/yyyy H:min', + 'value' => 'mm/dd/yyyy h:min am/pm', )); $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate'); } @@ -226,10 +226,11 @@ class Application_Form_EventEdit extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), + array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), ), 'required' => false, 'label' => 'Repeat End Date:', - 'value' => $this->params['repeatdate'], + 'value' => date('m/d/Y h:i a', strtotime($this->params['repeatdate'])), 'disabled' => true, )); } else { @@ -237,10 +238,11 @@ class Application_Form_EventEdit extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), + array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), ), 'required' => false, 'label' => 'Repeat End Date:', - 'value' => 'mm/dd/yyyy H:min', + 'value' => 'mm/dd/yyyy h:min am/pm', 'disabled' => true, )); } @@ -375,9 +377,21 @@ class Application_Form_EventEdit extends Zend_Form echo ''; } -- cgit v1.2.3-55-g7522