Skip to content

Commit

Permalink
Fix ControlDate
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Apr 15, 2019
1 parent d68cef6 commit adba3d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyforms_web/web/static/pyforms.js

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

5 changes: 4 additions & 1 deletion pyforms_web/web/static/pyformsjs/ControlDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class ControlDate extends ControlBase{

serialize(){
var d = this.get_value();
this.properties.value = d.getFullYear()+("0"+(d.getMonth()+1)).slice(-2)+ ("0" + d.getDate()).slice(-2);
if(d==null)
this.properties.value = null;
else
this.properties.value = d.getFullYear()+("0"+(d.getMonth()+1)).slice(-2)+ ("0" + d.getDate()).slice(-2);
return this.properties;
}

Expand Down

0 comments on commit adba3d5

Please sign in to comment.