jitendra873 / mobiscroll

Automatically exported from code.google.com/p/mobiscroll
0 stars 0 forks source link

formatDate() not returning correct value #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.using jQuery.scroller.formatDate()

What is the expected output? What do you see instead?
On selecting 12/17/2012 02:35 PM the variable initially shows the right time. 
But on using the formatDate() function the time gets converted to 12/17/2012 
14.12(for any time the minutes values becomes 12 i.e. 4.59 AM will  become 
04.12)

What version of the product are you using? On what operating system?
mobiscroll 2.3
on android

Please provide any additional information below.

Original issue reported on code.google.com by harsh.pa...@gmail.com on 17 Dec 2012 at 8:46

Attachments:

GoogleCodeExporter commented 9 years ago
Can you please show how are you calling the formatDate function?

Original comment by diosla...@gmail.com on 17 Dec 2012 at 9:04

GoogleCodeExporter commented 9 years ago
var date1= $("#i").scroller('getDate');
var date2= jQuery.scroller.formatDate('yy-MM-dd HH:mm:ss', date1);
/*
alert(date1.getHours()+':'+date1.getMinutes()+':'+date1.getSeconds());
this gives: 14.35.0
alert(date2);
this gives the value shown in the image
*/

Original comment by harsh.pa...@gmail.com on 17 Dec 2012 at 9:30

GoogleCodeExporter commented 9 years ago
You should use "ii" to get the minutes correctly. "mm" means month, that's why 
you always get 12.
Please take a look at the documentation of the datetime scroller's timeFormat 
option.
http://docs.mobiscroll.com/23/datetime-preseta

Original comment by diosla...@gmail.com on 17 Dec 2012 at 9:36

GoogleCodeExporter commented 9 years ago
Thank you!

Original comment by harsh.pa...@gmail.com on 17 Dec 2012 at 9:39