unicorn commit: added the current year to velocuty contexts

changeset:   1250:7c27da9cbdba
parent:      1247:909f3e1528b1
user:        Thomas Gambet <tgambet@w3.org>
date:        Wed Jun 16 10:34:43 2010 -0400
files:       src/org/w3c/unicorn/Framework.java
description:
added the current year to velocuty contexts


diff -r 909f3e1528b1 -r 7c27da9cbdba src/org/w3c/unicorn/Framework.java
--- a/src/org/w3c/unicorn/Framework.java	Tue Jun 15 17:18:56 2010 -0400
+++ b/src/org/w3c/unicorn/Framework.java	Wed Jun 16 10:34:43 2010 -0400
@@ -10,7 +10,9 @@
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.Hashtable;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -534,6 +536,7 @@
 			context.put("lang", locale.getName());
 			context.put("direction", Language.getLocaleDirection(locale));
 			context.put("defaultLocale", Language.getDefaultLocale());
+			context.put("year", (new SimpleDateFormat("yyyy")).format(new Date()));
 			languageContexts.put(locale, context);
 		}
 		logger.debug("> " + languageContexts.size() + " velocity context(s) created");

Received on Thursday, 17 June 2010 15:24:21 UTC