Skip to content

Conversation

codeconsole
Copy link
Contributor

@codeconsole codeconsole commented Oct 16, 2025

Show DateTime

7.0.0

Field Value
Calendar 2025-10-08 00:48:46 PDT
Date 2025-10-08 00:48:46 PDT
sql.Date Exception Thrown
sql.Time Exception Thrown
sql.Timestamp Exception Thrown
LocalTime Exception Thrown
Instant 2025-10-08T07:48:46.407254Z
Local Date Exception Thrown
Local DateTime 2025-10-08 00:48:46 PDT
OffsetDateTime 2025-10-08T00:48:46.407254-07:00
ZonedDateTime 2025-10-08T00:48:46.407254-07:00[America/Los_Angeles]

With This Fix

Field Value
Calendar 2025-10-08 00:48:46 PDT
Date 2025-10-08 00:48:46 PDT
sql.Date 2025-10-08 00:48:46 PDT
sql.Date 12:48 PM
sql.Time 12:48 PM
sql.Timestamp 2025-10-08 00:48:46 PDT
Instant 2025-10-08 00:48:46 PDT
Local Date 2025-10-08
Local DateTime 2025-10-08 00:48:46 PDT
OffsetDateTime 2025-10-08 00:48:46 PDT
ZonedDateTime 2025-10-08 00:48:46 PDT

Edit/Create DateTime

7.0.0

Field Value
Calendar Date Precision
Date Date Precision
sql.Date Date Precision
sql.Time Date Time Minute Precision
sql.Timestamp Broken
LocalTime Broken
Instant Broken
Local Date Broken
Local DateTime Date Time Minute Precision
OffsetDateTime Broken
ZonedDateTime Broken

With This Fix

Field Value
Calendar Date Precision
Date Date Precision
sql.Time Date Time Minute Precision
sql.Timestamp Broken
LocalTime Broken
Instant Date Precision
Local Date Date Precision
Local DateTime Date Time Minute Precision
OffsetDateTime Date Precision
ZonedDateTime Date Precision

Remaining JSON Issues:

Spring Boot

"time":"00:48:46","localTime":"00:48:46.407254",

Grails 7

"time":"2025-10-08T07:48:46.407Z","localTime":{"hour":0,"minute":48,"nano":407254000,"second":46}

@github-actions github-actions bot added the bug label Oct 16, 2025
Comment on lines +137 to +138
} else if (date instanceof Instant) {
zonedDateTime = ZonedDateTime.ofInstant(date, ZoneId.systemDefault())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, for a future version, make ZoneId.systemDefault() into something that could be configured?

@jdaugherty
Copy link
Contributor

We originally said "bug" fixes would only go in 7.0.1 and features in 7.1.0. I'm ok with the change going into 7.0.1, but we probably should make sure @jamesfredley & @matrei agree with this.

@codeconsole
Copy link
Contributor Author

codeconsole commented Oct 16, 2025

We originally said "bug" fixes would only go in 7.0.1 and features in 7.1.0. I'm ok with the change going into 7.0.1, but we probably should make sure @jamesfredley & @matrei agree with this.

Right, I think this is a bug fix because the new fields don't even work. @jdaugherty look at the Edit/Create view results

@codeconsole
Copy link
Contributor Author

I think we should move to second or even nanosecond precision in 7.1.x
Currently with dates in scaffold views, all time information is lost on update

@codeconsole
Copy link
Contributor Author

java.sql.Date on /show page results in

14:01:16,958 |-WARN in Logger[StackTrace] - No appenders present in context [default] for logger [StackTrace].
2025-10-17T14:01:16.959-07:00 ERROR 65880 --- [nio-8082-exec-4] .C.[.[.[.[dispatcherServletRegistration] : Servlet.service() for servlet [dispatcherServletRegistration] in context with path [] threw exception [Request processing failed: org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [Byte array resource [view:-,-,dateTime:show]:33] Error executing tag <f:display>: Unsupported field: HourOfDay] with root cause

java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay
        at java.base/java.time.LocalDate.get0(LocalDate.java:698)
        at java.base/java.time.LocalDate.getLong(LocalDate.java:678)
        at java.base/java.time.format.DateTimePrintContext$1.getLong(DateTimePrintContext.java:205)
        at java.base/java.time.format.DateTimePrintContext.getValue(DateTimePrintContext.java:308)
        at java.base/java.time.format.DateTimeFormatterBuilder$NumberPrinterParser.format(DateTimeFormatterBuilder.java:2915)
        at java.base/java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.format(DateTimeFormatterBuilder.java:2539)
        at java.base/java.time.format.DateTimeFormatter.formatTo(DateTimeFormatter.java:1905)
        at java.base/java.time.format.DateTimeFormatter.format(DateTimeFormatter.java:1879)
        at org.grails.plugins.web.DefaultGrailsTagDateHelper.format(DefaultGrailsTagDateHelper.groovy:108)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.selectMethod(IndyInterface.java:355)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.grails.plugins.web.taglib.FormatTagLib$_closure2.doCall(FormatTagLib.groovy:204)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at org.grails.taglib.TagOutput.captureTagOutput(TagOutput.java:84)
        at org.grails.taglib.TagLibraryMetaUtils$_registerMethodMissingForTags_closure3.doCall(TagLibraryMetaUtils.groovy:81)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at grails.plugin.formfields.FormFieldsTagLib.renderDefaultDisplay(FormFieldsTagLib.groovy:964)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants