Search code examples
javascriptjqueryjquery-mobilemobiscroll

Add time to the date value


I am using a jQuery plugin named mobiscroll to select a date, but the problem is that I also need to add to the result plus 15 minutes.

I have a function p(j), which returns 08/28/2012 12:15 - 12:15 (or only 08/28/2012 12:15 - as convenient), but instead i need 12:15 - 12:30. Are there any ideas?


Solution

  • According to the mobiscroll documentation setDate works with a Date object.

    See this link on how to work with date objects in javascript. You don't need to do any string manipulations.

    After you have the right date use the .scroller('setDate',newDate,true);