mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-01 17:09:08 +00:00
ping build
This commit is contained in:
parent
bf5c621f43
commit
0dfdb20f2b
@ -410,7 +410,7 @@ 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
|
||||
// locale - otherwise, format defaults to default for the Locale (which defaults to default Locale)
|
||||
if (isOnlyDate(type.getPrecision())) {
|
||||
DateTimeFormatter fmt = context.getDateFormat();
|
||||
if (fmt == null) {
|
||||
@ -430,7 +430,7 @@ public class DataRenderer extends Renderer {
|
||||
if (context.isTechnicalMode()) {
|
||||
fmt = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
} else {
|
||||
fmt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM);
|
||||
fmt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(context.getLocale());
|
||||
}
|
||||
}
|
||||
ZonedDateTime zdt = ZonedDateTime.parse(type.primitiveValue());
|
||||
|
@ -440,8 +440,16 @@ public class RenderingContext {
|
||||
return mode == ResourceRendererMode.TECHNICAL;
|
||||
}
|
||||
|
||||
public boolean hasLocale() {
|
||||
return locale != null;
|
||||
}
|
||||
|
||||
public Locale getLocale() {
|
||||
return locale;
|
||||
if (locale == null) {
|
||||
return Locale.getDefault();
|
||||
} else {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLocale(Locale locale) {
|
||||
|
@ -61,8 +61,8 @@ public class NarrativeGeneratorTests {
|
||||
rc.setDateTimeFormat(null);
|
||||
rc.setDateFormat(null);
|
||||
} else {
|
||||
rc.setDateTimeFormat(DateTimeFormatter.ofLocalizedDateTime(fmt));
|
||||
rc.setDateFormat(DateTimeFormatter.ofLocalizedDate(fmt));
|
||||
rc.setDateTimeFormat(DateTimeFormatter.ofLocalizedDateTime(fmt).withLocale(rc.getLocale()));
|
||||
rc.setDateFormat(DateTimeFormatter.ofLocalizedDate(fmt).withLocale(rc.getLocale()));
|
||||
}
|
||||
rc.setMode(mode);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user