patch by tobi, catching invalid date format errors and letting the now_macro write error output into the skin instead
This commit is contained in:
parent
15ae889600
commit
94d85929b4
1 changed files with 5 additions and 1 deletions
|
@ -52,7 +52,11 @@ function write_macro(param, text) {
|
||||||
function now_macro(param) {
|
function now_macro(param) {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
if (param.format) {
|
if (param.format) {
|
||||||
|
try {
|
||||||
res.write(d.format(param.format));
|
res.write(d.format(param.format));
|
||||||
|
} catch (e) {
|
||||||
|
res.write('<span title="' + e + '">[Invalid date format]</span>');
|
||||||
|
}
|
||||||
} else if (param.as == "timestamp") {
|
} else if (param.as == "timestamp") {
|
||||||
res.write(d.getTime());
|
res.write(d.getTime());
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue