Bug: Incorrect formattedValue in DataWidget with dateFormat set to "dd/MM/YYY"

Hi Retool community!

I've encountered what seems to be a bug with the DataWidget component. When I set the dateFormat property to "dd/MM/YYY" and assign the value "2023-12-31" to it, the formattedValue displayed is "31/12/2024" instead of "31/12/2023". This behavior is unexpected and doesn't align with the specified dateFormat.

To reproduce the issue:

  1. Add a DataWidget component to your Retool app.
  2. Set the dateFormat property to "dd/MM/YYY".
  3. Assign the value "2023-12-31" to the DataWidget.
  4. Observe that the displayed formattedValue is "31/12/2024" instead of "31/12/2023".

I have reviewed the Retool documentation, but couldn't find any mention of this issue or any recent updates related to the DataWidget component and its dateFormat property.

This is a sample app:
https://wf.st/dateWidgetBug

Could you please confirm if this is a bug or if I'm missing something in my implementation? If it is indeed a bug, it would be great to get an estimate on when this issue will be resolved.

Thank you in advance for your assistance!

Patrick

1 Like

Anyone? @Tess @kbn

:pray:

Patrick

?One more Y
dd/MM/YYYY

Hey @ScottR,

dd/MM/YYYY is not a valid unicode datetime format.

Patrick

Hey @PatrickMast I see what you're seeing. As a workaround, can you try using lower case "y"? Interestingly, this seems to display the right year!

Was chatting with some teammates and we found this related article https://dev.to/shane/yyyy-vs-yyyy-the-day-the-java-date-formatter-hurt-my-brain-4527 Apparently lower case "'y" represents calendar year and upper case "Y" represents the "year of the week" -- and this year, most of that week falls in 2024.

1 Like

Hey @kbn,

Works!! Thanks!

:grinning:

Patrick

1 Like