Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit 'kneath/master'

  • Loading branch information...
commit 66ba3abb8b562bf963711f94aaf0cf0fafbdf4c6 2 parents 0f0b9b9 + f029888
@Caged Caged authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/timeframe.js
View
11 src/timeframe.js
@@ -244,7 +244,7 @@ var Timeframe = new Class({
Marks a given date as the endpoint for the range
*/
markEndPoint: function(date){
- if (date < this.options.earliest || date > this.options.latest) return;
+ if ((this.options.earliest != null && date < this.options.earliest) || (this.options.latest != null && date > this.options.latest)) return;
// Are we just starting?
if (this.range.get('begining') == null){
@@ -259,6 +259,15 @@ var Timeframe = new Class({
if (date >= this.range.get('begining') || this.range.get('end') == null) this.range.set('end', this.range.get('start'));
this.range.set('start', date);
}
+
+ // Don't know how we get to this state, but sometimes we do. When beginning point is not within start/end point
+ if (this.range.get('start') < this.range.get('begining') && this.range.get('end') < this.range.get('begining')){
+ this.range.set('end', this.range.get('begining'));
+ }
+ if (this.range.get('start') > this.range.get('begining') && this.range.get('end') > this.range.get('begining')){
+ this.range.set('start', this.range.get('begining'));
+ }
+
this.fireEvent('rangeChange');
},
Please sign in to comment.
Something went wrong with that request. Please try again.