only call date function if needed in Ox.formatDate
This commit is contained in:
parent
2077ea718a
commit
37d9424ec8
1 changed files with 3 additions and 1 deletions
|
@ -348,7 +348,9 @@ Ox.formatDate <f> Formats a date according to a format string
|
||||||
}
|
}
|
||||||
date = Ox.makeDate(date);
|
date = Ox.makeDate(date);
|
||||||
format.forEach(function(value) {
|
format.forEach(function(value) {
|
||||||
string = string.replace(value[0], value[1](date, utc));
|
string = string.replace(value[0], function() {
|
||||||
|
return value[1](date, utc);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return string;
|
return string;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue