public
Description: Click-draggable. Range-makeable. A better calendar.
Homepage: http://stephencelis.com/projects/timeframe
Clone URL: git://github.com/stephencelis/timeframe.git
Search Repo:
Click here to lend your support to: timeframe and make a donation at www.pledgie.com !
name age message
folder .gitignore Sun Apr 20 19:35:00 -0700 2008 Initialization [stephencelis]
folder MIT-LICENSE Sun Apr 20 19:35:00 -0700 2008 Initialization [stephencelis]
folder README.markdown Sun Jun 08 10:23:06 -0700 2008 maxRange option! Now we can do a regular old da... [stephencelis]
folder TODO Sun Jun 08 10:23:06 -0700 2008 maxRange option! Now we can do a regular old da... [stephencelis]
folder example/ Sun Jun 08 11:43:06 -0700 2008 Get the IE styles up-to-date [stephencelis]
folder test/ Sun Jun 08 10:23:06 -0700 2008 maxRange option! Now we can do a regular old da... [stephencelis]
folder timeframe.js Thu Jun 12 13:46:16 -0700 2008 - Document must observe button clicks. [stephencelis]
README.markdown

Timeframe

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

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."

Notes:

  • I'm just sick of multiple date pickers on the same page.

An example:

See it in action here.

Dependencies:

Timeframe requires Prototype 1.6 or higher.

Download:

Find the latest version of Timeframe on Github.

More information can be found here.

Copyright (c) 2008 Stephen Celis, released under the MIT license.