Skip to content

[Calendar] should provide leading zero #508

@MarcelMpunkt

Description

@MarcelMpunkt

Feature Request

Description

in Forms the date is outputed in this format 6.5.1999
it should be possible to be like 06.05.1999 -> with leading zeros

Workaround

put certain if-statements in the formatter property
formatter: {
date: function (date, settings) {
if (!date) return '';
var day = date.getDate();
if (day.toString().length < 2) {
day = "0" + day
}

var month = date.getMonth() + 1;
if (month.toString().length < 2) {
month = "0" + month
}

var year = date.getFullYear();
return day + '.' + month + '.' + year;
}
},

Testcase

https://jsfiddle.net/tbkpz5cd/

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang/javascriptAnything involving JavaScripttype/featAny feature requests or improvements

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions