From 87c28116450d62fb4c16abc9cf5d5c6afb02782a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 22 Nov 2021 09:12:33 +1100 Subject: [PATCH] try Again! --- .../main/java/org/hl7/fhir/r5/renderers/DataRenderer.java | 6 +++--- .../java/org/hl7/fhir/r5/test/NarrativeGeneratorTests.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index c62cc4113..4be5ef656 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -410,14 +410,14 @@ public class DataRenderer extends Renderer { // dateTimeFormat - application specified format for date times // null = default to ... depends on mode // mode - if rendering mode is technical, format defaults to XML format - // locale - otherwise, format defaults to default for the Locale (which defaults to default Locale) + // locale - otherwise, format defaults to SHORT for the Locale (which defaults to default Locale) if (isOnlyDate(type.getPrecision())) { DateTimeFormatter fmt = context.getDateFormat(); if (fmt == null) { if (context.isTechnicalMode()) { fmt = DateTimeFormatter.ISO_DATE; } else { - fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).withLocale(context.getLocale()); + fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT).withLocale(context.getLocale()); } } @@ -430,7 +430,7 @@ public class DataRenderer extends Renderer { if (context.isTechnicalMode()) { fmt = DateTimeFormatter.ISO_OFFSET_DATE_TIME; } else { - fmt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(context.getLocale()); + fmt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT).withLocale(context.getLocale()); } } ZonedDateTime zdt = ZonedDateTime.parse(type.primitiveValue()); diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGeneratorTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGeneratorTests.java index e2a967a20..8fcab9bca 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGeneratorTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGeneratorTests.java @@ -90,19 +90,19 @@ public class NarrativeGeneratorTests { @Test public void testDateTimeRendering3() throws FHIRFormatError, DefinitionException, IOException { - checkDateTimeRendering("2021-11-19T14:13:12Z", "en", "AU", ZoneId.of("UTC"), FormatStyle.MEDIUM, ResourceRendererMode.TECHNICAL, "19 Nov. 2021, 2:13:12 pm"); + checkDateTimeRendering("2021-11-19T14:13:12Z", "en", "AU", ZoneId.of("UTC"), FormatStyle.SHORT, ResourceRendererMode.TECHNICAL, "19/11/21, 2:13 pm"); } @Test public void testDateTimeRendering4() throws FHIRFormatError, DefinitionException, IOException { - checkDateTimeRendering("2021-11-19T14:13:12Z", "en", "AU", ZoneId.of("UTC"), null, ResourceRendererMode.END_USER, "19 Nov. 2021, 2:13:12 pm"); + checkDateTimeRendering("2021-11-19T14:13:12Z", "en", "AU", ZoneId.of("UTC"), null, ResourceRendererMode.END_USER, "19/11/21, 2:13 pm"); } @Test public void testDateTimeRendering5() throws FHIRFormatError, DefinitionException, IOException { - checkDateTimeRendering("2021-11-19", "en", "AU", ZoneId.of("UTC"), null, ResourceRendererMode.END_USER, "19 Nov. 2021"); + checkDateTimeRendering("2021-11-19", "en", "AU", ZoneId.of("UTC"), null, ResourceRendererMode.END_USER, "19/11/21"); }