Unobtrusive datePicker Widgit
An attempt at writing a framework-free, keyboard accessible datePicker.
At a glance
- Keyboard shortcuts adhere to The DHTML Style Guide Working Group (DSGWG) recommendations
- Accessibility enhancements including support for ARIA Roles and States
- The script can parse and format dates using a subset of the PHP date conversion specifiers
- Both upper and lower date limits can be set
- Bespoke days of the week can be disabled
- Bespoke dates can be disabled/enabled and wildcards used to stipulate the dates in question
- Bespoke days of the week can be highlighted
- Works with any combination of text inputs or select lists
- DOM friendly – the calendar is only added to the DOM when actually required
- Includes a “smart” localisation option
- Can display an optional status bar and week numbers
- Can be dragged within the viewport by the user
- Global configuration parameters can be specified using JSON within the script tag itself
- The “button” used for popup datePickers can be arbitrarily positioned within the DOM and removed from the document tabindex if so desired
- The “button” updates to show a small cursor should the associated form element(s) contain a valid date
- Inline datePickers are now available (i.e. no button activation is required), are automatically added to the documents tabindex and can be arbitrarily positioned within the DOM
- A bespoke final opacity can be defined and the fade in/out animation effect disabled
- The entire grid can now be filled with dates
- The “Today” button can be removed from the U.I.
- No pesky images to upload and track on your server – they have all been (Base64) encoded directly into the CSS file
A demo is now available.
Note: The CSS file has been rewritten to use Base64 encoded images. I have tested in IE7+ but not yet in IE6. Theoretically, it should also be IE6 friendly (should anyone have tested the demo in IE6 and care to share that would be cool). Don’t worry, an alternative CSS file that does not use Base64 encoded images is also available.