ZF-DateTimePicker

ZF-DateTimePicker

Jquery Date time picker form element view helper integration to Zend Framework.

  • Language: PHP
    Framework: Zend Framework
  • Released: Feb 10, 2011
    Last Update: Feb 9, 2011

Jquery Date time picker (made by Trent Richardson:  [http://trentrichardson.com]) form element view helper integration to Zend Framework. 

Hide

Documentation

Add a form element to a Zend_Form object:

$date_time = new Core_Form_Element_DateTimePicker('call_date_time');
$date_time->setJQueryParams(array(
    'minDate' => 'new Date(' . date("Y") . ',' . date("m") . ',' . date('d') . ',' . date('H') . ',' . date('i') . ',' . date('s') . ')',
    'dateFormat' => 'yy-mm-dd',
    "timeFormat" => 'hh:mm:ss'
));
//$form is a Zend_Form object instance
$form->addElement(
    $date_time->setAttrib('size', '30')
              ->setLabel('call_date_time')
              ->setValue(date("Y-m-d H:i:s"))
);
Hide

Installation

Requiresments

  • ZendX library - must be included in your library path

Setup

  • Register helper path in your Bootstrap.php:
    protected function _initViewHelpers() {

            $this->bootstrap('layout');
            $layout = $this->getResource('layout');
            $view = $layout->getView();
    
            ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode();
            $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
            $view->addHelperPath('ZendX/JQuery/View/Helper/JQuery', 'ZendX_JQuery_View_Helper_JQuery');
            $view->addHelperPath('Core/View/Helper/', 'Core_View_Helper');
        }
  • Place the '/Core' directory under your library directory

  • Register new namespace in your application.ini file (¬†autoloaderNamespaces[] = "Core_"¬†)
  • In your layout.phtml file in the HEAD tag add:
    echo $this->headLink();

    echo $this->headScript();
    
    $this->jQuery ()
            ->setUiVersion ( '1.8.7' )
            ->setVersion ( '1.4.4' );
    echo $this->jQuery ();
You need to log-in or create an account
  • Create an account
  • Log-in
Please use your real name.
Activation link will be sent to this address.
Minimum 8 characters
Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

X

Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

License » GNU GPL Download
or Get a quote

for customization or integration services

  • Loved it--it was exactly what was needed.
    MH Marc Hampson
    2 years ago, 0 comments
    Was this helpful?
    Flag 1 of 1 people found this review helpful
  • Kind
    R ruton
    2 years ago, 0 comments
    Was this helpful?
    Flag
  • Kind of awesome.
    DK Daniil Kalnin
    2 years ago, 0 comments
    Was this helpful?
    Flag
Post a comment

Or enter your name and Email
  • L Luis 2 years ago
    Can you help me? Warning: Exception caught by form: Plugin by name 'DateTimePicker' was not found in the registry; used paths: ZendX_JQuery_View_Helper_: ZendX/JQuery/View/Helper/ Zend_View_Helper_: Zend/View/Helper/;C:/Program Files (x86)/Zend/Apache2/htdocs/32labs/application/views\helpers/ Stack Trace: #0 C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\Zend\View\Abstract.php(1182): Zend_Loader_PluginLoader->load('DateTimePicker') #1 C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\Zend\View\Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', 'dateTimePicker') #2 C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\Zend\View\Abstract.php(344): Zend_View_Abstract->getHelper('dateTimePicker') #3 C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\ZendX\JQuery\Form\Decorator\UiWidgetElement.php(168): Zend_View_Abstract->__call('dateTimePicker', Array) #4 C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\ZendX\JQuery\Form\Decorator\UiWidgetElement in C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\Zend\Form.php on line 2925
  • Darius Matulionis Developer 2 years ago
    If you want just a timepicker without the calendar just do like this: $duration = new Core_Form_Element_DateTimePicker('duration'); $duration->setJQueryParams(array( 'ampm' => false, 'hourGrid' => 4, 'minuteGrid' => 5, 'stepHour' => 1, 'stepMinute' => 5, )); $duration->setAttrib('timepicker', true); $this->addElement($duration->setLabel("Duration"));
  • R Robert 3 years ago
    How can I set to start from the actual date and time? Solved :)