LeftPad day/month/year
This commit is contained in:
parent
96c28738c4
commit
c102661590
@ -68,9 +68,9 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
var formatDate = function (date, format) {
|
var formatDate = function (date, format) {
|
||||||
return format
|
return format
|
||||||
.replace('%d', date.getDate())
|
.replace('%d', ("00" +date.getDate()).slice(-2))
|
||||||
.replace('%m', date.getMonth() + 1)
|
.replace('%m', ("00" + (date.getMonth() + 1)).slice(-2))
|
||||||
.replace('%Y', date.getFullYear());
|
.replace('%Y', ("0000" + date.getFullYear()).slice(-4));
|
||||||
};
|
};
|
||||||
|
|
||||||
function newDateFields(dateStr) {
|
function newDateFields(dateStr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user