Skip to content

Commit

Permalink
Date UI auto populate - Fixes #1244
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Aug 24, 2016
1 parent 86a8958 commit 030a2ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/core/uis/datetime/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ define(['app', 'core/UIComponent', 'core/UIView', 'moment', 'helpers/ui', 'core/
},

serialize: function() {
var date = this.value;
var settings = this.options.settings;
if (settings.get('auto-populate_when_hidden_and_null') === true && !this.value.isValid()) {
this.value = moment();
}

var date = this.value;
var dateValue = date.format('YYYY-MM-DD');

return {
Expand Down

0 comments on commit 030a2ec

Please sign in to comment.