Skip to content
This repository has been archived by the owner on Feb 14, 2019. It is now read-only.

Fixes #513 #626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions js/bootstrap-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,20 @@
},

hide: function () {
if (!this.isVisible) return;
function _setValue() {
if (
this.forceParse &&
(
this.isInput && this.element.val() ||
this.hasInput && this.element.find('input').val()
)
)
this.setValue();
};
if (!this.isVisible) {
_setValue.call(this);
return;
}
if (this.isInline) return;
this.picker.hide();
$(window).off('resize', this.place);
Expand All @@ -423,14 +436,8 @@
$(document).off('mousedown', this.hide);
}

if (
this.forceParse &&
(
this.isInput && this.element.val() ||
this.hasInput && this.element.find('input').val()
)
)
this.setValue();
_setValue.call(this);

this.isVisible = false;
this.element.trigger({
type: 'hide',
Expand Down