public
Description: Click-draggable. Range-makeable. A better calendar.
Homepage: http://stephencelis.com/projects/timeframe
Clone URL: git://github.com/stephencelis/timeframe.git
Search Repo:
Click here to lend your support to: timeframe and make a donation at www.pledgie.com !
stephencelis (author)
Wed Apr 23 06:46:53 -0700 2008
commit  368888b0313cb5cf7f81e40d6cf4e8b8da19a8f7
tree    cd3b6df4049276294c193cc7bdeec56439f5a0f0
parent  a6ebc2582c07b7363e9d9f14ec4feeab3916bb23
timeframe / example / example.html
100644 138 lines (137 sloc) 5.483 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
  <title>Timeframe</title>
  
  <link rel="stylesheet" href="stylesheets/timeframe.css" type="text/css" media="screen" title="timeframe" charset="utf-8"/>
  <!--[if IE 7]>
<style type="text/css" media="screen">
#calendar_navigation { margin: 0; }
</style>
<![endif]-->
  <!--[if IE 6]>
<link rel="stylesheet" href="stylesheets/ie6.css" type="text/css" media="screen" title="ie6" charset="utf-8">
<![endif]-->
</head>
<body>
  <div id="page_container">
    <h1><a href="http://github.com/stephencelis/timeframe">Timeframe</a><small>, by Stephen Celis</small></h1>
    <p>
      <em>Click-draggable. Range-makeable. A better calendar.</em>
    </p>
    <h3><a href="#example_information">Click here for the example.</a></h3>
    <h2>
      The code:
    </h2>
    <pre><code>
      new Timeframe(element, options);
    </code></pre>
    <h3>
      Options available:
    </h3>
    <dl>
      <dt><code>calendars</code></dt>
      <dd>The number of calendar months showing at once (default: <code>2</code>).</dd>
      <dt><code>format</code></dt>
      <dd>The <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/strftime.3.html">strftime</a> format for the dates in the input fields (default: <code>%b %d, %Y</code>).</dd>
      <dt><code>weekoffset</code></dt>
      <dd>The weekday offset (use <code>1</code> to start the week on Monday).</dd>
      <dt><code>startfield</code>, <code>endfield</code></dt>
      <dd>Declare the range start and end <code>input</code> tags (by default, these are generated with the timeframe).</dd>
      <dt><code>previousbutton</code>, <code>todaybutton</code>, <code>nextbutton</code>, <code>resetbutton</code></dt>
      <dd>Declare the navigational buttons (by default, these are also generated with the timeframe).</dd>
    </dl>
    <h3>Notes</h3>
    <ul>
      <li>I&rsquo;m just sick of multiple date pickers on the same page.</li>
    </ul>
    <h3>
      Also!!:
    </h3>
    <p>
      The <code>startfield</code> and <code>endfield</code> are parsed with <code>Date.parse()</code>, so feel free to use <a href="http://datejs.com/">Datejs.js</a> for ninja-quick date-parsing.
    </p>
    <h2 id="example_information">
      An example:
    </h2>
    <p>Warning, incompatibilities ahead!</p>
    <ul>
      <li>Not yet optimized for IE, though it works.</li>
      <li>Try <a href="http://apple.com/safari">Safari</a> for the best experience.
    </ul>
    <div id="example">
      <h4>Please select a date range below:</h4>
      <ul id="calendar_navigation">
        <li><a href="#" onclick="return false;" id="previous">&larr;</a></li>
        <li><a href="#" onclick="return false;" id="today">T</a></li>
        <li><a href="#" onclick="return false;" id="next">&rarr;</a></li>
      </ul>
      <div id="calendars"></div>
      <div id="calendar_form">
        <div id="labels">
          <label for="start">Embarkation</label> and <label for="end">return</label> (<a href="#" onclick="return false;" id="reset">reset</a>):
        </div>
        <div id="fields">
          <span>
            <input type="text" name="start" value="" id="start"/>
            &ndash;
            <input type="text" name="end" value="" id="end"/>
          </span>
        </div>
      </div>
    </div>
    <p>
      Generated from this code (see the source for more detail):
    </p>
    <pre><code>
      &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
        //&lt;![CDATA[
          new Timeframe(&#x27;calendars&#x27;, {
            startfield: &#x27;start&#x27;,
            endfield: &#x27;end&#x27;,
            previousbutton: &#x27;previous&#x27;,
            todaybutton: &#x27;today&#x27;,
            nextbutton: &#x27;next&#x27;,
            resetbutton: &#x27;reset&#x27; });
        //]]&gt;
      &lt;/script&gt;
    </code></pre>
    <h2>Contact/contribution:</h2>
    <p>
       Timeframe is open source and available for forking, pushing, and pulling at <a href="http://github.com">Github</a>:
    </p>
    <p>
      <a href="http://github.com/stephencelis/timeframe">http://github.com/stephencelis/timeframe</a>
    </p>
    <p>
      Contact me with questions/comments at
      <script type="text/javascript">
      //<![CDATA[
      document.write(
"<n uers=\"znvygb:fgrcura\100fgrcurapryvf\056pbz\">fgrcura\100fgrcurapryvf\056pbz<\057n>".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
        //]]>
      </script>.
    </p>
    <p>
      Learn more about me at <a href="http://stephencelis.com">http://stephencelis.com</a>.
    </p>
    <p>
      Copyright &copy; 2008 Stephen Celis. Provided under the MIT License.
    </p>
  </div>
  <script type="text/javascript" charset="utf-8" src="scripts/prototype.js"></script>
  <script type="text/javascript" charset="utf-8" src="../timeframe.js"></script>
  <script type="text/javascript" charset="utf-8">
    //<![CDATA[
      new Timeframe('calendars', {
        startfield: 'start',
        endfield: 'end',
        previousbutton: 'previous',
        todaybutton: 'today',
        nextbutton: 'next',
        resetbutton: 'reset' });
    //]]>
  </script>
</body>
</html>