Skip to content

Commit

Permalink
Fix time interaction with anchor:null
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthornton committed Oct 4, 2015
1 parent de32199 commit 90205df
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datepair.js",
"version": "0.4.9",
"version": "0.4.10",
"main": ["dist/datepair.js", "dist/jquery.datepair.js"],
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion datepair.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datepair",
"version": "0.4.9",
"version": "0.4.10",
"title": "Datepair.js",
"description": "A plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
"author": {
Expand Down
11 changes: 10 additions & 1 deletion dist/datepair.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* datepair.js v0.4.9 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
* datepair.js v0.4.10 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
* Copyright (c) 2015 Jon Thornton - http://jonthornton.github.com/Datepair.js
* License: MIT
*/
Expand Down Expand Up @@ -270,6 +270,15 @@
var newTime = new Date(endTime.getTime() - this.timeDelta);
this.settings.updateTime(this.startTimeInput, newTime);
startTime = this.settings.parseTime(this.startTimeInput);
} else {
if (endTime < startTime) {
var otherInput = hasClass(target, this.settings.startClass) ? this.endTimeInput : this.startTimeInput;
var selectedTime = this.settings.parseTime(target);
this.timeDelta = 0;
this.settings.updateTime(otherInput, selectedTime);
} else {
this.timeDelta = endTime.getTime() - startTime.getTime();
}
}

var newDelta = endTime.getTime() - startTime.getTime();
Expand Down
4 changes: 2 additions & 2 deletions dist/datepair.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/jquery.datepair.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* datepair.js v0.4.9 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
* datepair.js v0.4.10 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
* Copyright (c) 2015 Jon Thornton - http://jonthornton.github.com/Datepair.js
* License: MIT
*/
Expand Down
Loading

0 comments on commit 90205df

Please sign in to comment.