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:
zumbrunn 2008-12-16 13:23:33 +00:00
parent 15ae889600
commit 94d85929b4

View file

@ -52,7 +52,11 @@ function write_macro(param, text) {
function now_macro(param) {
var d = new Date();
if (param.format) {
res.write(d.format(param.format));
try {
res.write(d.format(param.format));
} catch (e) {
res.write('<span title="' + e + '">[Invalid date format]</span>');
}
} else if (param.as == "timestamp") {
res.write(d.getTime());
} else {