• Stars
    star
    287
  • Rank 144,232 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 16 years ago
  • Updated over 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

SQLite.swift

A type-safe, Swift-language layer over SQLite3.
Swift
9,718
star
2

ghi

GitHub Issues on the command line. Use your $EDITOR, not your browser.
Ruby
2,135
star
3

syn

Syntax control for the command line
Objective-C
377
star
4

Formatting

Type-safe, functional string formatting in Swift.
Swift
248
star
5

sc_listener

A simple class for listening to microphone levels, suitable for the iPhone.
Objective-C
131
star
6

app

Easy App config.
Ruby
97
star
7

haddock

A more memorable password generator.
Ruby
88
star
8

githubbub

GitHubbub: A GitHub Fluid userscript. Growl/Dock notifications, and more.
JavaScript
84
star
9

minifacture

factory_girl for minitest
Ruby
69
star
10

BRLOptionParser

A short wrapper for getopt_long(3). Command line options parsing for Objective-C.
Objective-C
50
star
11

acts_as_singleton

A lightweight singleton library for your Active Record models.
Ruby
47
star
12

rdoctest

A doctest for Ruby. Parses RDoc text for examples and tests them.
Ruby
37
star
13

SQLiteCipher.swift

SQLite.swift + SQLCipher
Swift
33
star
14

dots

Free progress dots for your scripts. Test::Unit-style.
Ruby
33
star
15

vim-mml

Music Macro Language (MML) VIM plug-in. Edit, compile, and play NES chiptunes.
C
31
star
16

dotfiles

gone fishing
Ruby
26
star
17

rerails

Reinforcing the Rails with assorted patches.
Ruby
21
star
18

kvc

KVC (Key-Value Configuration): a powerful, transparent way to maintain mutable app settings in the database.
Ruby
14
star
19

ScreenshotWatcher

A demonstration of testing uncertainty in Swift Concurrency
Swift
7
star
20

scantron

Rule-based string scanning and scrubbing.
Ruby
7
star
21

Gestures.swift

iOS block-based gesture helpers.
Swift
7
star
22

EnumRuntimeBug

Swift
2
star
23

gorilla

Unit conversion for the underdog.
Ruby
2
star
24

actionview-data

HTML5 data attribute helpers for ActionView.
Ruby
1
star
25

swift-remove-first-benchmark

Swift
1
star
26

Platformer

Playing with Flixel.
ActionScript
1
star
27

scptest

Swift
1
star
28

CSQLite

System module for sqlite3
Swift
1
star
29

ghi-playground

Nothing to see here, folks.
1
star