ZF2" Zend \ Form \ Element \ Time"给出错误的信息

时间:2015-03-29 09:18:38

标签: php forms time zend-framework2

我的表单中有以下元素,但在提交时,它会不断发出消息“输入似乎不是有效日期”。这不是一个日期,它是一个时间元素。我没有应用过滤器。

    $this->add(array(
        'name' => 'starttime',
        'type' => 'Zend\Form\Element\Time',
        'options' => array(
            'label' => _("Start time"),
            'format' => 'H:i:s'
        ),
        'attributes' => array(
            'min' => '00:00:00',
            'max' => '23:59:59',
            'step' => 60 * 15, // seconds; default step interval is 60 seconds
        )
    ));

我做错了什么?

1 个答案:

答案 0 :(得分:0)

尝试编辑“步骤”,如:60而不是60 * 15

此输入被视为“日期格式”,如果您愿意,可以更改默认错误消息:“输入似乎不是有效时间”

相关问题