Search code examples
jqueryasp.netiosjquery-mobilemobiscroll

mobiscroll date/time .setdate


I am pretty new to mobile stuff, jquery... Here is the situation I have an asp.net page, and I am using jquery mobile. Everything is going well. I am trying to get mobiscroll date/time selector to work the way I want. I have the mobiscroll selector able to populate the textbox field, and I then use this value to update the database. All is well

When I try to update the data through the same form I run into problems. I can query the database, and populate the form items with the appropiate date/time stored in the database, but when I click into the date/time textbox, the mobiscroll selector shows todays date, and not the date that was poplulated into the textbox.

I have tried using setdate with no success, and a snippet of code that used the beforeShow event, again with no success.

I am confused, if the mobiscroll control can open by clicking into the textbox why wouldn't it set the date/time if it had a value in the textbox, or am I doing something wrong?

Can someone please clarify this for me, and show me a snippet of code that with set the date of the mobiscroll from the textbox it is tied too?


Solution

  • Per this post http://code.google.com/p/mobiscroll/issues/detail?id=44

    Try changing the format of the date you are setting.

    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.