Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ensure valid date for time picker

  • Loading branch information...
commit e28efadadb8b2dc003412f2d920b630cf3ce7e86 1 parent dc88525
@jcarrig jcarrig authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  src/js/time_picker.js
View
3  src/js/time_picker.js
@@ -133,6 +133,8 @@
if(!!this.model && this.options.content) {
var boundDate = this.resolveContent();
var updatedDate = new Date(boundDate);
+ // Ensure we are updating a valid Date object
+ updatedDate = isNaN(updatedDate.getTime()) ? new Date() : updatedDate;
updatedDate.setHours(newDate.hours());
updatedDate.setMinutes(newDate.minutes());
_(this.model).setProperty(this.options.content, updatedDate);
@@ -143,5 +145,6 @@
}
}
}
+
});
}());
Please sign in to comment.
Something went wrong with that request. Please try again.