forked from redhat-developer-demos/quarkus-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting of dates in Qute templates
Fixes: redhat-developer-demos#7
- Loading branch information
Showing
3 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/org/quarkus/samples/petclinic/Temporals.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
* <a href="https://github.com/redhat-developer-demos/quarkus-petclinic/issues/7">this</a> issue. | ||
* <p> | ||
* The problem appears to be M1 specific and is being | ||
* <a href="https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/petclinic">looked</a> 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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters