From 94d85929b468db4946c99c0d7dd81bf5bca569ed Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Tue, 16 Dec 2008 13:23:33 +0000 Subject: [PATCH] patch by tobi, catching invalid date format errors and letting the now_macro write error output into the skin instead --- core/Global.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/Global.js b/core/Global.js index 7b0b2fdf..18dcd43a 100644 --- a/core/Global.js +++ b/core/Global.js @@ -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('[Invalid date format]'); + } } else if (param.as == "timestamp") { res.write(d.getTime()); } else {