W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2010

unicorn commit: added the current year to velocuty contexts

From: Mercurial notifier <nobody@w3.org>
Date: Thu, 17 Jun 2010 11:21:40 -0400
To: Unicorn Updates <www-validator-cvs@w3.org>
Message-Id: <E1OPGuS-0003Pg-8i@blinky.w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:20 GMT