GitXplorerGitXplorer
s

timeframe

public
288 stars
55 forks
1 issues

Commits

List of commits on branch master.
Unverified
368dad8ffae0bb0246ca34a11a16f7a681b6b210

Clean up boolean logic.

sstephencelis committed 14 years ago
Unverified
29c97c286ab94bed5743afe10fa1f5e130d72836

Update copyright.

sstephencelis committed 14 years ago
Unverified
c96ed31440089a9a2a4c78c48c8849004cdd0539

Merge pull request #5 from willbryant/master

sstephencelis committed 14 years ago
Unverified
5bb5d990ddc771aac71b3ab148fe4e9b44ebd358

add an onFinished event to complement onClear; rearrange slightly so you don't get both when clearing

wwillbryant committed 14 years ago
Unverified
9708f09a568cbd3ea8aad40fa2c402708bb61b19

Update README (contributors, etc.).

sstephencelis committed 14 years ago
Unverified
5b24dac0547e526fbfd735148ad7ec200592e99e

Merge pull request #4 from willbryant/master

sstephencelis committed 14 years ago

README

The README file for this repository.

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:

<script type="text/javascript" charset="utf-8">
  //<![CDATA[
    new Timeframe('calendars', {
      startField: 'start',
      endField: 'end',
      earliest: new Date(),
      resetButton: 'reset' });
  //]]>
</script>

See it in action here.

Dependencies:

Timeframe requires Prototype 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.

More information can be found here.

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