Search code examples
javascriptmobiscroll

Mobiscroll formatting date and time to Dayday:hour:minute


I'm trying to find a way to combine the day/date/month into one string on the first wheel into:

  1st         2nd   3rd
+------------+----+----+
| thu 27 sep | 17 | 00 |
| fri 28 sep | 18 | 00 |
+------------+----+----+

Where first wheel is: day/Date/month, second: hour, third: minute Any clues?

A follow up question would be: How do I get todays day to display as 'Today' ?


Solution

  • You can achieve this by generating your own custom wheels. I have put an example of doing it here:

    http://jsfiddle.net/Rd5m8/1/

    You will have to rewrite a bit in the parseValue, and formatResult if you want today displayed as 'Today'. Let me know if you have any difficulties!