- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据本文档,http://jqueryui.com/demos/datepicker/#option-altFormat
我可以设置不同的日期格式供用户查看,以及实际发送到服务器的不同格式。
但是,两者似乎显示相同的格式。
这是我的代码:
$("#joindate").datepicker({
dateFormat: $.datepicker.TIMESTAMP,
altFormat: 'yy-mm-dd'
});
而且,我希望用户看到 yy-mm-dd 格式,并使用我的发布请求将时间戳发送到服务器。我已经切换了 altFormat 和 dateFormat 的值,但要么在两个(文本框和 $_POST)中都得到 yy-mm-dd,要么在两者中都得到时间戳。
有解决办法吗?
最佳答案
我想你一定要读一下这篇文章
The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function
引用:
关于jQuery datepicker "dateFormat"和 "altFormat"之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5619658/
我有日期字段(id 开始日期) $( "#begin-date" ).datepicker({ minDate: -20, maxDate: "+1M +10D", dateFormat:
我有一个 jQuery 日期选择器,它根据卖家的语言偏好进行本地化。每个日期选择器自定义都有不同的日期格式,但我希望提交表单时的输入采用特定的格式进行解析。我尝试在日期选择器上使用 altFormat
jQuery datepicker 有一个名为 altFormat 的函数,它允许您向用户显示日期格式,同时使用另一个日期格式作为值。 如何向用户显示 01/01/1970,同时将 1970-01-0
根据本文档,http://jqueryui.com/demos/datepicker/#option-altFormat 我可以设置不同的日期格式供用户查看,以及实际发送到服务器的不同格式。 但是,两
我有一个带有日期输入的表单 我正在使用我在页面底部制作的 datepicker jquery 对象 $(function(){$("#date").datepicker();}); 当我有这个时,
我正在尝试获取“从”和“到”的日期范围,以将其添加到我的数据库中。我使用 altFormat 和 altField 捕获 DB 格式 (yy-mm-dd) 的日期,同时使用 Datepicker jq
我正在尝试定义一个带有两个替代日期显示字段的日期输入字段,其中它们都具有不同的日期格式。在下面的示例中,如果我的日期输入是 013017,那么我希望显示我的替代日期显示字段 Display 1: 20
我是一名优秀的程序员,十分优秀!