Symfony2中的jQuery日期选择器提供';此值无效。';
我在symfony2表单中添加了一个jQuery日期选择器 细枝文件:Symfony2中的jQuery日期选择器提供';此值无效。';,jquery,symfony,jquery-ui-datepicker,Jquery,Symfony,Jquery Ui Datepicker,我在symfony2表单中添加了一个jQuery日期选择器 细枝文件: $('.date').datepicker({ showOn: 'button', buttonImageOnly: true, changeMonth: true, changeYear: true, dateFormat: 'yy-MM-dd ', yearRange: "-0:+1" }); PostType.php $builder->add('toD
$('.date').datepicker({
showOn: 'button',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
dateFormat: 'yy-MM-dd ',
yearRange: "-0:+1"
});
PostType.php
$builder->add('toDate','date',array(
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
'attr' => array('class' => 'date')
))
我试过几种约会方式。但是我总是得到
这个值是无效的。
当我提交时。我试图获取表单错误,但它没有提供更多信息。尝试类似的方法
$('.date').datepicker({
showOn: 'button',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
dateFormat: 'dd-mm-yy',
yearRange: "-0:+1"
});
PostType.php
$builder->add('toDate','date',array(
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
'attr' => array('class' => 'date')
))
我只是想说清楚
在jQuery UI中:
mm = "01"
MM = "January"
在Symfony:
mm // is not valid format
MM == "01"
Symfony MM与jQuery UI MM相同太好了,它可以工作!有关于这个日期格式和jquery的文档吗?只是要指出,这篇文章太棒了!非常感谢Rajeshit,因为Symfony中的MM和jQuery UI中的MM返回相同的结果