X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2Foutput%2Ftemplate%2FTemplate.java;h=cb0bed02b0fd8019f18e1eddb01ca070505b539e;hp=ad53ac2ed4492ccbff4ec54598896d328fdc41b7;hb=e7532e90c74f2fd2559c6afead1748b2f29edf8e;hpb=dd3dc340b33fdf14109bf86853a38951676584ed diff --git a/src/club/wpia/gigi/output/template/Template.java b/src/club/wpia/gigi/output/template/Template.java index ad53ac2e..cb0bed02 100644 --- a/src/club/wpia/gigi/output/template/Template.java +++ b/src/club/wpia/gigi/output/template/Template.java @@ -73,6 +73,8 @@ public class Template implements Outputable { private static final String UNKOWN_CONTROL_STRUCTURE_MSG = "Unknown control structure \"%s\", did you mean \"%s\"?"; + public static final String UTC_TIMESTAMP_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; + /** * Creates a new template by parsing the contents from the given URL. This * constructor will fail on syntax error. When the URL points to a file, @@ -264,10 +266,14 @@ public class Template implements Outputable { out.print(((Boolean) s) ? l.getTranslation("yes") : l.getTranslation("no")); } else if (s instanceof Date) { SimpleDateFormat sdfUI = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - out.print(""); + if (vars.containsKey(Outputable.OUT_KEY_PLAIN)) { + out.print(sdfUI.format(s)); + } else { + SimpleDateFormat sdf = new SimpleDateFormat(UTC_TIMESTAMP_FORMAT); + out.print(""); + } } else { out.print(s == null ? "null" : (unescaped ? s.toString() : HTMLEncoder.encodeHTML(s.toString()))); }