ajanthanm / mobiscroll

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

Does not parse time. #61

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Goto demo.
2. Note that default time is set to 11:23 AM
3. Click on the time field, default scroller values are the current time.

What is the expected output? What do you see instead?
Expected 11:23 AM to be selected, instead current time was selected.

What version of the product are you using? On what operating system?
1.5.2

Original issue reported on code.google.com by brad.ste...@gmail.com on 2 Jan 2012 at 4:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Setting time with the setValue function will change the value in the display 
box, but does not change value for the scroll wheel when activated.

var date2Values=new Array(); 
date2Values[0]="1";    
date2Values[1]="1";
date2Values[2]="AM";
 $('#date2').scroller('setValue', date2Values);

Original comment by brad.ste...@gmail.com on 2 Jan 2012 at 4:52

GoogleCodeExporter commented 8 years ago
Issue does not happen when preset is set to datetime, but only when preset is 
set to time.

Original comment by brad.ste...@gmail.com on 2 Jan 2012 at 5:11

GoogleCodeExporter commented 8 years ago
Traced the issue down to lines 301 and 302 in mobiscroll-1.5.2.js

if (date.getFullYear() != year || date.getMonth() + 1 != month || 
date.getDate() != day)
    throw 'Invalid date'; // E.g. 31/02/*

Original comment by brad.ste...@gmail.com on 2 Jan 2012 at 6:09

GoogleCodeExporter commented 8 years ago
I found the bug, line 184 should be:
  month = def.getMonth() + 1,

Thanks for the bug report, the fix will be included in the next release.

Original comment by diosla...@gmail.com on 3 Jan 2012 at 7:28

GoogleCodeExporter commented 8 years ago
Fixed in 1.5.3

Original comment by diosla...@gmail.com on 3 Jan 2012 at 10:09