Date picker. Return a selcetor with all the date components.

@param string $name
@param AnDate  $date
@param array  $options
9494
public function picker($name, $options = array())
    {
        $options = new AnConfig($options);

        $options->append(array(
            'date' => new AnDate(),
        ));

        $date = $options->date;

        $html = $this->getService('com:base.template.helper.html');

        if (is_string($date)) {
            $date = new AnDate(new AnConfig(array('date' => $date)));
        }

        $month = $date->month;
        $year = $date->year;
        $day = $date->day;

        $months = array(
            0 => 'Select Month',
            1 => AnTranslator::_('JANUARY') ,
            2 => AnTranslator::_('FEBRUARY') ,
            3 => AnTranslator::_('MARCH')  ,
            4 => AnTranslator::_('APRIL')  ,
            5 => AnTranslator::_('MAY')    ,
            6 => AnTranslator::_('JUNE')   ,
            7 => AnTranslator::_('JULY')    ,
            8 => AnTranslator::_('AUGUST') ,
            9 => AnTranslator::_('SEPTEMBER') ,
            10 => AnTranslator::_('OCTOBER') ,
            11 => AnTranslator::_('NOVEMBER') ,
            12 => AnTranslator::_('DECEMBER') ,
        );

        $days = array(0 => 'Select Day');
        $years = array(0 => 'Select Year');

        foreach (range(1, 31) as $i => $num) {
            $days[$i + 1] = $num;
        }

        $current = new AnDate();

        foreach (range(0, 100) as $i) {
            $years[$current->year + $i] = $current->year + $i;
        }

        $year = $html->select($name.'[year]', array('options' => $years,  'selected' => $year))->class('input-medium');
        $month = $html->select($name.'[month]', array('options' => $months, 'selected' => $month))->class('input-medium');
        $day = $html->select($name.'[day]', array('options' => $days,   'selected' => $day))->class('input-small');

        return $year.' '.$month.' '.$day;
    }
1112298
public function tab($name, array $options = [])
    {
        if (!isset($options['label'])) {
            $options['label'] = 'form.tab_' . $name;
        }

        return parent::tab($name, $options);
    }
839374
function(options, $input, columnName) {
        var datePicker = this.datePickerMap[columnName];
        var format = options.format || DEFAULT_DATE_FORMAT;
        var date = options.date || (new Date());
        var selectableRanges = options.selectableRanges;

        datePicker.setInput($input, {
            format: format,
            syncFromInput: true
        });

        if (selectableRanges) {
            datePicker.setRanges(selectableRanges);
        } else {
            datePicker.setRanges(FULL_RANGES);
        }

        if ($input.val() === '') {
            datePicker.setDate(date);
            $input.val('');
        }
    }
1233889
public function datepicker($fieldName, $options = [])
    {
        $defaults = [
            'class' => 'form-control form-control-datepicker',
            'type' => 'text',
        ];
        $options = array_merge($defaults, $options);
        return parent::input($fieldName, $options);
    }
1281358
public static function addScript(string $name, array $options = [])
    {
        if (! in_array($name, self::getScripts()))
            self::$scripts[] = $name;
        self::setOptions($name, $options);
    }
1150300
@Override
    public void setDateHeader(String name, long date) {

        setHeader(name, CmsDateUtil.getHeaderDate(date));
    }
1144542
protected function nullableDate(string $name): Closure
    {
        return function (Table $table) use ($name) {
            $table->addColumn($name, Type::DATE)->setNotnull(false);
        };
    }
750558
private function checkDateIsValid($date, $canBeNull = false)
    {
        if ($date === null
            && $canBeNull
        ) {
            return;
        }

        Date::factory($date);
    }
838882
public function text($name, $options = [])
    {
        $requiredClass = (isset($options['required']) && $options['required'] == true) ? 'required ' : '';
        $hasError = $this->errorBag->has($this->formatArrayName($name));
        $hasErrorClass = $hasError ? 'has-error' : '';
        $htmlForm = '<div class="form-group '.$requiredClass.$hasErrorClass.'">';

        $htmlForm .= $this->setFormFieldLabel($name, $options);

        if (isset($options['addon'])) {
            $htmlForm .= '<div class="input-group">';
        }
        if (isset($options['addon']['before'])) {
            $htmlForm .= '<span class="input-group-prepend"><div class="input-group-text">'.$options['addon']['before'].'</div></span>';
        }

        $type = isset($options['type']) ? $options['type'] : 'text';
        $value = isset($options['value']) ? $options['value'] : null;
        $fieldAttributes = $this->getFieldAttributes($options);

        if (isset($options['placeholder'])) {
            $fieldAttributes += ['placeholder' => $options['placeholder']];
        }

        if ($hasError) {
            $fieldAttributes['class'] .= ' is-invalid';
        }

        $htmlForm .= FormFacade::input($type, $name, $value, $fieldAttributes);

        if (isset($options['addon']['after'])) {
            $htmlForm .= '<span class="input-group-append"><div class="input-group-text">'.$options['addon']['after'].'</div></span>';
        }
        if (isset($options['addon'])) {
            $htmlForm .= '</div>';
        }

        $htmlForm .= $this->getInfoTextLine($options);

        $htmlForm .= $this->errorBag->first($this->formatArrayName($name), '<span class="invalid-feedback" role="alert">:message</span>');

        $htmlForm .= '</div>';

        return $htmlForm;
    }
416911
public function addInputDate(string $name) : Element\Input\Date
    {
        $input = new Element\Input\Date($this, $name);
        $this->addComponent($name, $input);

        return $input;
    }
881258
public function date($name, $value = null, $format = 'yy-mm-dd', $htmlOptions = array())
    {
        $return = Html::get()->mpfScriptFile('jquery.js') . Html::get()->mpfScriptFile('jquery-ui/jquery-ui.js');
        if (!isset($htmlOptions['id'])) {
            $htmlOptions['id'] = 'mdate-time' . str_replace(array('[', ']'), array('_', '__'), $name) . $this->_date_input_count;
            if (WebApp::get()->request()->isAjaxRequest()){
                $htmlOptions['id'] = 'ajax-'.$htmlOptions['id'];
            }            
            $this->_date_input_count++;
        }
        $s = Html::get()->script("$(function(){\$(\"#{$htmlOptions['id']}\").datepicker({dateFormat: '$format'});});");
        return $return . $this->input($name, 'text', $value, $htmlOptions) . $s;
    }
302272
def unobtrusive_date_picker(object_name, method, options = {}, html_options = {})
      ActionView::Helpers::InstanceTag.new(object_name, method, self, options.delete(:object)).to_datepicker_date_select_tag(options, html_options)
    end
1235943
public function datepickerInput(string $field, array $options = []): string
    {
        $options = Hash::merge([
            'type' => 'date',
        ], $options);

        return $this->Form->input($field, $options);
    }
1202444
public function date($name, $value = null, $min = null, $max = null, $options = array())
    {
        if( !isset($min) && !isset($max) ) return 'The date field "'.$name.'" must have a min, max or both.';
        
        if( isset($min) ) $options['min'] = $min;
        if( isset($max) ) $options['max'] = $max;
        
		return $this->input('date', $name, $value, $options);
    }
144556
public function select($name, $options = array(), $selected = null, array $attributes = array(), array $extra = array())
    {
        /**
         * Swap values so programmers can skip the $value argument
         * and pass the $attributes array directly.
         */
        if (is_array($selected) && empty($attributes)) {
            $extra = $attributes;
            $attributes = $selected;
            $selected = null;
        }

        return $this->doBuild('select', $name, $selected, $attributes, $extra, $options);
    }
817354
protected function setDateProperty(string $name, Carbon $date)
    {
        if (str_is('due', $name)) {
            $this->googleTasks->setDue($date);
        }

        if (str_is('updated', $name)) {
            $this->googleTasks->setUpdated($date);
        }
    }
617982
public static function calendar($name, $value = null, $options = array())
	{
		static $done;

		if ($done === null)
		{
			$done = array();
		}

		$readonly = isset($options['readonly']) && $options['readonly'] == 'readonly';
		$disabled = isset($options['disabled']) && $options['disabled'] == 'disabled';
		$time     = isset($options['time']) ? (bool)$options['time'] : true;

		$format = 'yy-mm-dd';
		if (isset($options['format']))
		{
			$format = $options['format'] ? $options['format'] : $format;
			unset($options['format']);
		}

		if (!isset($options['class']))
		{
			$options['class'] = 'calendar-field';
		}
		else
		{
			$options['class'] = ' calendar-field';
		}

		if (!$readonly && !$disabled)
		{
			// Load the calendar behavior
			Behavior::calendar();
			Behavior::tooltip();

			$id = self::getIdAttribute($name, $options);

			// Only display the triggers once for each control.
			if (!in_array($id, $done))
			{
				if ($format == 'Y-m-d H:i:s' || $format == '%Y-%m-%d %H:%M:%S')
				{
					$time = true;
				}
				$altformats = array('Y-m-d H:i:s', '%Y-%m-%d %H:%M:%S', 'Y-m-d', '%Y-%m-%d');

				$format = (in_array($format, $altformats) ? 'yy-mm-dd' : $format);

				\App::get('document')->addScriptDeclaration("
					jQuery(document).ready(function($){
						" . ($time ? "$('#" . $id . "').datetimepicker({" : "$('#" . $id . "').datepicker({") . "
							duration: '',
							showTime: true,
							constrainInput: false,
							stepMinutes: 1,
							stepHours: 1,
							altTimeField: '',
							time24h: true,
							dateFormat: '" . $format . "'" . ($time ? ", timeFormat: 'HH:mm:00'" : "") . "
						});
					});
				");

				$done[] = $id;
			}

			return '<span class="input-datetime">' . self::text($name, $value, $options) . '</span>';
		}
		else
		{
			$value = (0 !== (int) $value ? with(new Date($value))->format('Y-m-d H:i:s') : '');

			return self::text($name . 'disabled', (0 !== (int) $value ? with(new Date($value))->format('Y-m-d H:i:s') : ''), $options) .
				   self::hidden($name, $value, $options);
		}
	}