Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Earliest & Latest fully implemented

  • Loading branch information...
commit 9f4dd04068766c0efdccfdd95ea60efcb87ac07d 1 parent 1917c1c
Kyle Neath authored

Showing 3 changed files with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. +0 1  TODO
  2. +1 1  example/index.html
  3. +3 1 src/timeframe.js
1  TODO
... ... @@ -1,2 +1 @@
1   -* Implement options.earliest & options.latest
2 1 * Implement maxRange
2  example/index.html
@@ -59,7 +59,7 @@
59 59 <div id="wrapper">
60 60 <div id="calendar"></div>
61 61 <script type="text/javascript" charset="utf-8">
62   - new Timeframe('calendar', {months: 3, latest: "December 15, 2008"});
  62 + new Timeframe('calendar', {months: 3, latest: "December 15, 2008", earliest: "July 15, 2008"});
63 63 </script>
64 64 </div>
65 65 </body>
4 src/timeframe.js
@@ -169,7 +169,7 @@ var Timeframe = new Class({
169 169 'text': date.getDate(),
170 170 'class': inactive || 'active'
171 171 });
172   - if ((this.options.earliest && date < this.earliest) || (this.latest && date > this.latest)){
  172 + if ((this.options.earliest && date < this.options.earliest) || (this.options.latest && date > this.options.latest)){
173 173 dayCell.addClass('unselectable');
174 174 }else{
175 175 dayCell.addClass('selectable');
@@ -239,6 +239,8 @@ var Timeframe = new Class({
239 239 Marks a given date as the endpoint for the range
240 240 */
241 241 markEndPoint: function(date){
  242 + if (date < this.options.earliest || date > this.options.latest) return;
  243 +
242 244 // Are we just starting?
243 245 if (this.range.get('begining') == null){
244 246 this.range.set('start', date);

0 comments on commit 9f4dd04

Please sign in to comment.
Something went wrong with that request. Please try again.