public
Description: Click-draggable. Range-makeable. A better calendar.
Homepage: http://stephencelis.com/projects/timeframe
Clone URL: git://github.com/stephencelis/timeframe.git
Click here to lend your support to: timeframe and make a donation at www.pledgie.com !
stephencelis (author)
Sun Apr 27 08:20:23 -0700 2008
commit  b08e9a3358d7fff50d4828b61202b8e53d3cd0d8
tree    9aaba8a3802fee9af468e52fc6b22b0aaba458a4
parent  2c81b22e8902f56b6a3926cba54b4752a1855c88
name age message
file .gitignore Sun Apr 20 19:35:00 -0700 2008 Initialization [stephencelis]
file MIT-LICENSE Sun Apr 20 19:35:00 -0700 2008 Initialization [stephencelis]
file README.markdown Sat May 03 08:11:24 -0700 2008 New options: `earliest`, `latest`. Field valida... [stephencelis]
file TODO Sat May 03 08:11:24 -0700 2008 New options: `earliest`, `latest`. Field valida... [stephencelis]
directory example/ Sat May 03 08:11:25 -0700 2008 Add the example GUI stylesheet. [stephencelis]
file timeframe.js Sat May 03 08:11:25 -0700 2008 Validate fields when attempts are made to parse [stephencelis]
README.markdown

Timeframe

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

The code:

new Timeframe(element, options);

Options available:

  • calendars: 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).

  • weekoffset: The weekday offset (use 1 to start the week on Monday).

  • startfield, endfield: Declare the range start and end input tags (by default, these are generated with the timeframe).

  • 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()).

Notes

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

Also!!:

The startfield and endfield are parsed with Date.parse(), so feel free to use Datejs for ninja-quick date-parsing.

An example:

<script type="text/javascript" charset="utf-8">
  //<![CDATA[
    new Timeframe('calendars', {
      startfield: 'start',
      endfield: 'end',
      previousbutton: 'previous',
      todaybutton: 'today',
      nextbutton: 'next',
      resetbutton: 'reset' });
  //]]>
</script>

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 at here.

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