我对移动的东西很陌生,jquery...这是我的情况 有一个 asp.net 页面,我正在使用 jquery mobile。一切都是 进展顺利。我正在尝试让 mobiscroll 日期/时间选择器按照我想要的方式工作。我 让 mobiscroll 选择器能够填充文本框字段,我 然后使用这个值来更新数据库。一切顺利
当我尝试通过遇到的相同表单更新数据时 问题。我可以查询数据库,并填充表单项 存储在数据库中的适当日期/时间,但是当我单击 进入日期/时间文本框,mobiscroll 选择器显示今天的日期, 而不是填充到文本框中的日期。
我试过使用 setdate 但没有成功,还有一段代码 使用 beforeShow 事件,再次没有成功。
我很疑惑,如果mobiscroll控件点进去就可以打开 文本框为什么不设置日期/时间,如果它在 文本框,还是我做错了什么?
谁能帮我澄清一下,并给我看一段代码 从它绑定(bind)的文本框中设置mobiscroll的日期 也是吗?
最佳答案
根据这篇文章http://code.google.com/p/mobiscroll/issues/detail?id=44
尝试更改您正在设置的日期的格式。
Comment 2 by project member diosla...@gmail.com, Oct 17, 2011
Well... it does not appear in the documentation, but you must use 'yy' for 4 digit, and 'y' for 2 digit year format in your dateFormat option, like in the jquery UI datepicker. In your case change 'dd.mm.yyyy' to 'dd.mm.yy' and your problem is gone.
关于jquery - mobiscroll 日期/时间.setdate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9123363/