PSA: This plugin's initial codebase is pretty creaky at this point, and working on it isn't high priority for me right now. I'm open to someone else taking it over, or just letting it fade into the technological distance in favor of newer code & interface techniques. Thanks for using Minical over the years, and although I reserve the right to suddenly change my mind and make it awesome again, consider this main fork dormant.
Feel free to check out the source on GitHub.
Why It's Awesome
Minical is teeny (~300 lines of Coffeescript), and has no dependencies other than jQuery. It has full keyboard support. It's an easy way to get your users to input a readable, parsable date value.
Minical exposes a few Sass variables for easy skinning:
In this case, you can just output a
date_format method, so you don't even need to set an initial value for the input itself.)
Either string or integer formats will work, but the most foolproof
+my_date_object). This renders a value of
12/13/2013 using the default date_format method:
Minical tracks its own state internally, so just changing its input's value directly will cause the two to get out of sync. You can manipulate a Minical instance through some external methods:
$input.minical('clear')clears the input and resets Minical to its initial state
change.minical_externalevent rather than a
$input.minical('destroy')removes the Minical element completely
offset: positions calendar relative to the bottom-left corner of the input
xdefaults to 0
ydefaults to 5
trigger: A function (run in the context of the minical-enhanced input) that returns a jQuery object of the desired trigger, or a string selector to specify a trigger element (like the calendar icon in the examples). The string selector can be a child or sibling of the element on which you call
align_to_trigger: (boolean) align the calendar to the trigger instead of the input. Defaults to
read_only: makes the date/text input only modifiable by the calendar. Defaults to
date_format: allows you to output a custom date format from the chosen Date object (defaults to MM/DD/YYYY)
to: date objects specifying min and max valid dates.
date_changed: callback that fires after the input or dropdowns have changed value.
month_drawn: callback that fires when a new month is rendered.
appendCalendarTo: function; should return jQuery element. Minical appends to
initialize_with_date: defaults to true; Minical will write the initial date to the input (either via data-minical-initial or just by displaying today)
show_clear_link: defaults to false; displays a 'clear date' link in the calendar popout