• Stars
    star
    287
  • Rank 139,370 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 16 years ago
  • Updated almost 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,494
star
2

ghi

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

syn

Syntax control for the command line
Objective-C
375
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
98
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
35
star
13

dots

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

SQLiteCipher.swift

SQLite.swift + SQLCipher
Swift
32
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
25
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
15
star
19

scantron

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

Gestures.swift

iOS block-based gesture helpers.
Swift
7
star
21

ScreenshotWatcher

A demonstration of testing uncertainty in Swift Concurrency
Swift
6
star
22

gorilla

Unit conversion for the underdog.
Ruby
2
star
23

actionview-data

HTML5 data attribute helpers for ActionView.
Ruby
1
star
24

swift-remove-first-benchmark

Swift
1
star
25

EnumRuntimeBug

Swift
1
star
26

Platformer

Playing with Flixel.
ActionScript
1
star
27

scptest

Swift
1
star
28

ghi-playground

Nothing to see here, folks.
1
star