Skip to content

Commit

Permalink
Fix #106: More correct validation for guessing date without ajax conv…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
kartik-v committed Jan 8, 2017
1 parent cd750a2 commit 4b0d4a8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Expand Up @@ -14,6 +14,7 @@ Change Log: `yii2-datecontrol`
- `afterpaste.datecontrol`: will be triggered when a data is pasted in the date input on the client.
- (enh #96, #102): Ignore timezone conversion for `DateControl::FORMAT_DATE`.
- (bug #105): Set date control plugin data correctly within widget options.
- (bug #106): More correct validation for guessing date without ajax conversion.

## version 1.9.5

Expand Down
2 changes: 1 addition & 1 deletion assets/js/datecontrol.js
Expand Up @@ -62,7 +62,7 @@
} else {
if (isEmpty(vUrl)) {
var vDispDate = vFormatter.parseDate($el.val(), vDispFormat);
if (vDispDate === false) {
if (vDispDate === false || vDispDate === null || String(vDispDate).length === 0) {
vDispDate = vFormatter.guessDate($el.val(), vDispFormat);
$el.val(vFormatter.formatDate(vDispDate, vDispFormat));
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/datecontrol.min.js

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

0 comments on commit 4b0d4a8

Please sign in to comment.