Chart Trouble with java.util.Date

Hello, I have an entity with a java.util.Date property. I was having trouble building a line trend chart where this date attribute was the TIME category. There was no line. So I created a Transient property for the date that transformed the value to java.time.LocalDate, used that in the chart instead and it worked. Can I ask for some advice?

  1. Is this the intended functionality or a bug?

  2. Is using LocalDate type for date attributes the preferred approach?

Hi

my guess is this is because java.util.Date is an API are from too old times, there were 3 java datetime epochs:

  1. java.util.Date and friends
  2. Calendar API supposed as replacement
  3. New APIs respecting zonality like LocalDateTime

as of Charts, they use frontend javascript library rendering so convert your values to string sometimes can be the best option

1 Like