Skip to content

Commit

Permalink
hotfix for Eonasdan#140 and Eonasdan#151
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonasdan committed Jan 29, 2014
1 parent b34acc3 commit 0007e57
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ Finally include the main javascript file.

# Change Log

## 2.1.32 (Hotfix)

* Fix for #151: When a bad date value or the picker is cleared, the plugin will not longer attempt to reset it back to the previous date
* Fix for #140: `setDate` can be given `null` to force clear the picker

## 2.1.30
#### Important! `build.less` file name has been been changed to `bootstrap-datetimepicker-build.less` to prevent collisions

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eonasdan-bootstrap-datetimepicker",
"version": "2.2.20",
"version": "2.2.22",
"main": [
"build/css/bootstrap-datetimepicker.min.css",
"build/js/bootstrap-datetimepicker.min.js"
Expand Down
4 changes: 2 additions & 2 deletions build/js/bootstrap-datetimepicker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-datetimepicker",
"version": "2.1.30",
"version": "2.1.32",
"main": ["build/css/bootstrap-datetimepicker.min.css","build/js/bootstrap-datetimepicker.min.js"],
"dependencies": {
"jquery" : ">=1.8.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-datetimepicker",
"version": "2.1.30",
"version": "2.1.32",
"repository": {
"type": "git",
"url": "git://github.com/eonasdan/bootstrap-datetimepicker.git"
Expand Down
15 changes: 8 additions & 7 deletions src/js/bootstrap-datetimepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* version 2.1.30
* version 2.1.32
* @license
* =========================================================
* bootstrap-datetimepicker.js
Expand Down Expand Up @@ -62,7 +62,7 @@
startDate: new pMoment({ y: 1970 }),
endDate: new pMoment().add(50, "y"),
collapse: true,
language: pMoment.lang(),
language: "en",
defaultDate: "",
disabledDates: [],
enabledDates: false,
Expand Down Expand Up @@ -668,8 +668,6 @@
}
else {
picker.viewDate = oldDate;
input.val(pMoment(oldDate).format(picker.format));
//picker.setValue(""); // unset the date when the input is erased
notifyChange(oldDate, e.type);
notifyError(newDate);
picker.unset = true;
Expand Down Expand Up @@ -1032,6 +1030,7 @@
pMoment.lang(picker.options.language);
if (!newDate) {
picker.unset = true;
set();
} else {
picker.unset = false;
}
Expand All @@ -1054,9 +1053,11 @@
},

picker.setDate = function (date) {
date = pMoment(date);
if (!date) picker.setValue(null);
else picker.setValue(date);
if (!date) {
picker.setValue(null);
} else {
picker.setValue(pMoment(date));
}
},

picker.setEnabledDates = function (dates) {
Expand Down

0 comments on commit 0007e57

Please sign in to comment.