To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Show
Ignore:
Timestamp:
07/30/10 16:44:58 (19 months ago)
Author:
dordille
Message:

Made new fields start_time and end_time for events.
Added new time widget.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheBlogPlugin/trunk/lib/form/doctrine/PluginaEventForm.class.php

    r1576 r1866  
    1919    parent::setup(); 
    2020 
    21     $this->setWidget('start_date', new sfWidgetFormJQueryDateTime( 
    22                         array('date' => array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
    23                 )); 
    24      
    25     $this->setValidator('start_date', new sfValidatorDateTime( 
     21    $this->setWidget('start_date', new sfWidgetFormJQueryDate( 
     22                        array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
     23                ); 
     24 
     25    $this->setValidator('start_date', new sfValidatorDate( 
    2626      array( 
    2727        'required' => true, 
    2828      ))); 
    2929 
    30     $this->setWidget('end_date', new sfWidgetFormJQueryDateTime( 
    31                         array('date' => array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
    32                 )); 
     30    $this->setWidget('start_time', new aWidgetFormJQueryTime(array(), array('size' => 8))); 
     31    $this->setValidator('start_time', new sfValidatorTime(array('required' => false, 'time_output' => 'g:iA'))); 
    3332 
    34     $this->setValidator('end_date', new sfValidatorDateTime( 
     33    $this->setWidget('end_date', new sfWidgetFormJQueryDate( 
     34                        array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
     35                ); 
     36 
     37    $this->setValidator('end_date', new sfValidatorDate( 
    3538      array( 
    3639        'required' => true, 
    3740      ))); 
    3841 
    39     if($this->getObject()->getStartDate() == $this->getObject()->getEndDate()) 
    40     { 
    41       $this->getWidget('start_date')->addOption('with_time', false); 
    42       $this->getWidget('end_date')->addOption('with_time', false); 
    43     } 
     42    $this->setWidget('end_time', new aWidgetFormJQueryTime(array(), array('size' => 8))); 
     43    $this->setValidator('end_time', new sfValidatorTime(array('required' => false, 'time_output' => 'g:iA'))); 
    4444 
    4545    $this->getWidgetSchema()->setDefault('start_date', date('Y/m/d'));