Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Mobiscroll Custom Control

Hi,

I am attempting to implement mobiscroll with custom wheels as in:

http://jsfiddle.net/kovlex/3bScd/9/

I get an error: Uncaught TypeError: Object [object Object] has no method 'scroller'

Is this not possible in Tiggzi.

Regards,
Joe

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mobiscroll Custom Control

Hi Joe! Working on it...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mobiscroll Custom Control

We tested - it works. Please ensure you've added next resources:

http://demo.mobiscroll.com/Content/cs...
http://demo.mobiscroll.com/Content/js...

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Mobiscroll Custom Control

Hi Marina,

I had uploaded the wrong version. With the correct version it now works perfectly. Apart from date values, I should probably be asking this elsewhere but you might be able to help. I have placed the mobiscroll datepicker in an input and set the date format to 'dd Dmm yy' this displays properly in the control but when a value is selected I get the value 'mm/dd/yyyy' I suppose I could grab the control updated event and parse the returned value but it would be easier if this could be set at load time.

Regards,
Joe
Image

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

Mobiscroll Custom Control

Hi Joe,
i'm using mobiscroll,
the js on click to get date and time, the following code returns a date of
dd/mm/yy

hope this helps

codevar Date1 = Tiggr('Date1Val');
var selectedDate = Date1.scroller('getDate');
var m = (selectedDate.getMonth()+1 9) ? "" + (selectedDate.getMonth()+1) : "0" + (selectedDate.getMonth()+1),
d = (selectedDate.getDate() 9) ? "" + (selectedDate.getDate()) : "0" + (selectedDate.getDate()),
y = selectedDate.getFullYear();
var dateString = d + "/" + m + "/" + y;
localStorage.setItem('selectedDate', dateString);

var Time1 = Tiggr('Time1Val');
var selectedTime = Time1.scroller('getDate');
var h = (selectedTime.getHours() 9) ? "" + selectedTime.getHours() : "0" + selectedTime.getHours(),
m = (selectedTime.getMinutes() 9) ? "" + selectedTime.getMinutes() : "0" + selectedTime.getMinutes(),
s = (selectedTime.getSeconds() 9) ? "" + selectedTime.getSeconds() : "0" + selectedTime.getSeconds();
var timeString = h + ":" + m + ":" + s;
localStorage.setItem('selectedTime', timeString);code
/code/code

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Mobiscroll Custom Control

Hi Michael, Thanks for your code.

Return to “Issues”