From 73c36d3e3f185e42bd475897f38a6e5d2a3ccef6 Mon Sep 17 00:00:00 2001 From: quasi Date: Mon, 4 Jan 2010 13:27:25 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20f=C3=BCr=20die=20Anzeige=20von=20Datum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Erweitert das XML-Tag um die Attribute date und time, die die jeweiligen Informationen in für die ausgehandelte Locale formatiert enthalten. git-svn-id: https://svn.libreccm.org/ccm/trunk@317 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/domain/DomainObjectXMLRenderer.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java b/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java index c9456f4e3..8fb2a29e0 100755 --- a/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java +++ b/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java @@ -25,14 +25,14 @@ import com.arsdigita.xml.Element; import java.util.Calendar; import java.util.Date; -import java.util.HashMap; -import java.util.Map; import com.arsdigita.xml.XML; +import java.text.DateFormat; import java.util.Stack; import java.util.Map; import java.util.HashMap; +import java.util.Locale; import org.apache.log4j.Logger; /** @@ -358,6 +358,16 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal { element.addAttribute("hour", Integer.toString(calDate.get(Calendar.HOUR_OF_DAY))); element.addAttribute("minute", Integer.toString(calDate.get(Calendar.MINUTE))); element.addAttribute("second", Integer.toString(calDate.get(Calendar.SECOND))); + + // Quasimodo: BEGIN + // Add attributes for date and time + Locale negLocale = com.arsdigita.dispatcher.DispatcherHelper.getRequestContext().getLocale(); + DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, negLocale); + DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, negLocale); + element.addAttribute("date", dateFormatter.format(date)); + element.addAttribute("time", timeFormatter.format(date)); + // Quasimodo: END + } } } else {