An open API service indexing awesome lists of open source software.

https://github.com/stephencelis/timeframe

Click-draggable. Range-makeable. A better calendar.
https://github.com/stephencelis/timeframe

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

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](http://datejs.com), 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](http://datejs.com), 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:
-----------


//<![CDATA[
new Timeframe('calendars', {
startField: 'start',
endField: 'end',
earliest: new Date(),
resetButton: 'reset' });
//]]>

See it in action
[here](http://stephencelis.com/projects/timeframe#example_information).

Dependencies:
-------------

Timeframe requires [Prototype](http://prototypejs.org) 1.6 or higher.

Contributors:
-------------

* Justin Palmer ("Caged")
* Nik Wakelin ("codetocustomer")
* Sebastien Grosjean ("ZenCocoon")
* Will Bryant ("willbryant")

Download:
---------

Find the latest version of Timeframe on
[Github](http://github.com/stephencelis/timeframe).

More information can be found
[here](http://stephencelis.com/projects/timeframe).

Copyright (c) 2008-2011 [Stephen Celis](http://stephencelis.com), released under
the [MIT license](http://en.wikipedia.org/wiki/Mit_license).