date_popup нужна только дата.

Главные вкладки

Аватар пользователя smartchecker smartchecker 22 июня 2011 в 19:17

Описано так.

    function value_form(&$form, &$form_state) {

        $date_format = 'Y-m-d';

        $form['value']['from_date'] = array(
            '#title' => t('От'),
            '#type' => 'date_popup',
            '#date_format' => $date_format,
            '#description' => t('Дата начала периода'),
            '#date_year_range' => '-3:+0',
            '#default_value' => array(
                'year' => format_date(time(), 'custom', 'Y'),
                'month' => format_date(time(), 'custom', 'n'),
                'day' => format_date(time(), 'custom', 'j'),
            )
        );

Хочу чтобы возращало только дату в том формате, в котором я хочу.
А получаю 2011-06-22 00:00:00.
Как избавиться от времени?

Комментарии