update date rendering

This commit is contained in:
Grahame Grieve 2024-03-25 15:58:40 +11:00
parent a4055877c4
commit 459f04a490
3 changed files with 6 additions and 5 deletions

View File

@ -40,7 +40,7 @@ public class ListRenderer extends ResourceRenderer {
XhtmlNode tr = t.tr();
XhtmlNode td = tr.td();
if (list.has("date")) {
td.tx(/*!#*/"Date: "+list.get("date").dateTimeValue().toHumanDisplay());
td.tx(/*!#*/"Date: "+context.toStr(list.get("date").dateTimeValue()));
}
if (list.has("mode")) {
td.tx(/*!#*/"Mode: "+list.get("mode").primitiveValue());
@ -113,7 +113,7 @@ public class ListRenderer extends ResourceRenderer {
XhtmlNode t = x.table("clstu");
XhtmlNode tr = t.tr();
if (list.hasDate()) {
tr.td().tx(/*!#*/"Date: "+list.getDate().toLocaleString());
tr.td().tx(/*!#*/"Date: "+context.toStr(list.getDateElement()));
}
if (list.hasMode()) {
tr.td().tx(/*!#*/"Mode: "+list.getMode().getDisplay());

View File

@ -55,7 +55,7 @@ public class ProvenanceRenderer extends ResourceRenderer {
if (prv.hasRecorded()) {
tr = t.tr();
tr.td().tx(/*!#*/"Recorded");
tr.td().addText(prv.getRecordedElement().toHumanDisplay());
tr.td().addText(context.toStr(prv.getRecordedElement()));
}
if (prv.hasPolicy()) {
tr = t.tr();

View File

@ -18,6 +18,7 @@ import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.elementmodel.Element;
import org.hl7.fhir.r5.fhirpath.FHIRPathEngine.IEvaluationContext;
import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.BaseDateTimeType;
import org.hl7.fhir.r5.model.DateTimeType;
import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.model.Extension;
@ -745,7 +746,7 @@ public class RenderingContext extends RenderingI18nContext {
return nf.format(v);
}
public String toStr(DateTimeType dt) {
public String toStr(BaseDateTimeType dt) {
return dt.toHumanDisplay();
}