Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Form / Element / DateTimeLocal.php
blobc35fde8fb4470e8ac823eb477c0fcf4ebcd82165
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Form\Element;
12 use Zend\Validator\DateStep as DateStepValidator;
14 class DateTimeLocal extends DateTime
16 const DATETIME_LOCAL_FORMAT = 'Y-m-d\TH:i';
18 /**
19 * Seed attributes
21 * @var array
23 protected $attributes = array(
24 'type' => 'datetime-local',
27 /**
28 * {@inheritDoc}
30 protected $format = self::DATETIME_LOCAL_FORMAT;
32 /**
33 * Retrieves a DateStepValidator configured for a Date Input type
35 * @return \Zend\Validator\ValidatorInterface
37 protected function getStepValidator()
39 $stepValue = (isset($this->attributes['step']))
40 ? $this->attributes['step'] : 1; // Minutes
42 $baseValue = (isset($this->attributes['min']))
43 ? $this->attributes['min'] : '1970-01-01T00:00';
45 return new DateStepValidator(array(
46 'format' => $this->format,
47 'baseValue' => $baseValue,
48 'step' => new \DateInterval("PT{$stepValue}M"),
49 ));