mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-06 19:39:27 +00:00
try Again!
This commit is contained in:
parent
e012b9e9cb
commit
87c2811645
@ -410,14 +410,14 @@ public class DataRenderer extends Renderer {
|
|||||||
// dateTimeFormat - application specified format for date times
|
// dateTimeFormat - application specified format for date times
|
||||||
// null = default to ... depends on mode
|
// null = default to ... depends on mode
|
||||||
// mode - if rendering mode is technical, format defaults to XML format
|
// 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())) {
|
if (isOnlyDate(type.getPrecision())) {
|
||||||
DateTimeFormatter fmt = context.getDateFormat();
|
DateTimeFormatter fmt = context.getDateFormat();
|
||||||
if (fmt == null) {
|
if (fmt == null) {
|
||||||
if (context.isTechnicalMode()) {
|
if (context.isTechnicalMode()) {
|
||||||
fmt = DateTimeFormatter.ISO_DATE;
|
fmt = DateTimeFormatter.ISO_DATE;
|
||||||
} else {
|
} 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()) {
|
if (context.isTechnicalMode()) {
|
||||||
fmt = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
fmt = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||||
} else {
|
} else {
|
||||||
fmt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(context.getLocale());
|
fmt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT).withLocale(context.getLocale());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ZonedDateTime zdt = ZonedDateTime.parse(type.primitiveValue());
|
ZonedDateTime zdt = ZonedDateTime.parse(type.primitiveValue());
|
||||||
|
@ -90,19 +90,19 @@ public class NarrativeGeneratorTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDateTimeRendering3() throws FHIRFormatError, DefinitionException, IOException {
|
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
|
@Test
|
||||||
public void testDateTimeRendering4() throws FHIRFormatError, DefinitionException, IOException {
|
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
|
@Test
|
||||||
public void testDateTimeRendering5() throws FHIRFormatError, DefinitionException, IOException {
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user