public
Description: Click-draggable. Range-makeable. A better calendar. In MooTools.
Homepage:
Clone URL: git://github.com/kneath/timeframe-mootools.git
kneath (author)
Mon Nov 03 18:29:31 -0800 2008
commit  8f4968367e6ea456c8c74d0433b273e13570b785
tree    1084af7c71a8b117a3ebe3ed03c41e539944255a
parent  95a69033dd7cf51e05357ea33b66d0e905f663e4
name age message
file .gitignore Thu Oct 16 20:45:01 -0700 2008 Add libraries & skeleton [kneath]
file LICENSE Sun Oct 19 14:41:52 -0700 2008 Spell stephen's name right [kneath]
file README.markdown Sun Oct 19 22:47:56 -0700 2008 Let everyone know it works now :) [kneath]
file TODO Sun Oct 19 22:46:41 -0700 2008 Date fields now in sync [kneath]
directory example/ Sun Oct 19 15:17:36 -0700 2008 Earliest & Latest fully implemented [kneath]
directory lib/ Thu Oct 16 20:45:01 -0700 2008 Add libraries & skeleton [kneath]
directory spec/ Mon Nov 03 18:29:31 -0800 2008 Fix date formatting for IE7 [kneath]
directory src/ Mon Nov 03 18:29:31 -0800 2008 Fix date formatting for IE7 [kneath]
README.markdown

Timeframe

Click-draggable. Range-makeable. A better calendar. In MooTools.

A port of Stephen Celis's Timeframe for Prototype. The Public API should be the same.

A work in progress

This is still a work in process, but it should be mostly working at this point.

The Code

new Timeframe(element, options);

Options available:

  • months: The number of calendar months showing at once (default: 2).

  • format: The strftime format for the dates in the input fields (default: %b %d, %Y). (With Datejs, it takes Datejs formatting.)

  • weekOffset: Override the localization's default weekday start with this option (e.g., 1 will force the rows to start on Monday; use 0 for Sunday).

  • startField, endField: Declare the range start and end input tags (by default, these are generated with the Timeframe). When the value attribute is pre-populated, the Timeframe will load with this range.

  • previousButton, todayButton, nextButton, resetButton: Declare the navigational buttons (these are also generated by default with the Timeframe).

  • earliest, latest: The earliest and latest selectable dates (accepts either a Date object or a String that can be parsed with Date.parse()).

  • maxRange: Limit the maximum possible range length (set to 1 to turn Timeframe into a regular old date picker).

Localization:

Drop in a localized version of Datejs, and it should just work. An added bonus is that the text fields will live-parse more nicely! Just try "next tues."