acidb/mobiscroll — pull request #3 by malandrew (2011-11-17 19:08:19+00:00)
Title: 'day' and relative 'daytime' presets

acidb, dioslaska,

How's it going?

I have two new presets I created that may or may not be interesting for you guys. They are 'day' and 'daytime'.

'day' basically lets you select a date up to seven days in the future. 'daytime' lets you select a date up to seven days in the future and set a time as well.

Currently, neither has checks to prevent inputs outside that range. I assume in good faith that the original value will be a time between now and +7 days. I haven't figured out if this is necessary or not, or even investigated where in the code is the appropriate place to put such validation logic.

Ultimately, my idea is to move this towards a simple relative interface for dates up to 7 days in the future and the ability to toggle on/off a calendar for dates farther into the future.

Let me know what you think of these modifications and if they are of interest to the project.

Best,
Andrew

PS - What would be great would be a "module" system in Mobiscroll that separates the scroller logic from the presets and associated functions (e.g. getDate, parseDate, etc.). This would make it easy for the community to add new custom modules such as these two I created or other presets such as State or Country selectors and whatnot. It would also allow people to keep the code they serve to the client lean since they would only need to include the modules they are using.