diff --git a/src/main/java/org/quarkus/samples/petclinic/Temporals.java b/src/main/java/org/quarkus/samples/petclinic/Temporals.java new file mode 100644 index 0000000..7ec7756 --- /dev/null +++ b/src/main/java/org/quarkus/samples/petclinic/Temporals.java @@ -0,0 +1,22 @@ +package org.quarkus.samples.petclinic; + +import io.quarkus.qute.TemplateExtension; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +/** + * This is a temporary hack around + * this issue. + *

+ * The problem appears to be M1 specific and is being + * looked into by the Quarkus devs. + */ +@TemplateExtension +public class Temporals { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + public static String format(LocalDate localDate) { + return localDate.format(FORMATTER); + } +} diff --git a/src/main/resources/templates/createOrUpdateVisitForm.html b/src/main/resources/templates/createOrUpdateVisitForm.html index 9ab4e56..4d381f6 100644 --- a/src/main/resources/templates/createOrUpdateVisitForm.html +++ b/src/main/resources/templates/createOrUpdateVisitForm.html @@ -17,7 +17,7 @@

{pet.name} - {pet.birthDate.format('yyyy-MM-dd')} + {pet.birthDate.format()} {pet.type.name} {pet.owner.firstName} {pet.owner.lastName} @@ -74,7 +74,7 @@

{#if visit} {#for v in pet.visits} - {v.date.format('yyyy-MM-dd')} + {v.date.format()} {v.description} {/for} {/if} diff --git a/src/main/resources/templates/ownerDetails.html b/src/main/resources/templates/ownerDetails.html index 264b956..6dc2039 100644 --- a/src/main/resources/templates/ownerDetails.html +++ b/src/main/resources/templates/ownerDetails.html @@ -42,7 +42,7 @@

{msg:pets_and_visits}

{msg:name}
{pet.name}
{msg:birthdate}
-
{pet.birthDate.format('yyyy-MM-dd')}
+
{pet.birthDate.format()}
{msg:type}
{pet.type.stringify}
@@ -62,7 +62,7 @@

{msg:pets_and_visits}

{#for visit in pet.visits} - {visit.date.format('yyyy-MM-dd')} + {visit.date.format()} {visit.description ?: ''} {/for}