Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin 8: Renderer for LocalDate(Time) Column in Grid

Alexander Ley
5 years ago Jan 26, 2017 12:13pm

"Vaadin 8 is all about Java 8".
So I think there should be a Renderer for LocalDate(Time) Objects in Vaadin 8 to show them in Grids.
I could only find DateRenderer for java.util.Date.
Have I missed anything? Any hints?
 

Pere Pasqual
5 years ago Jan 26, 2017 12:43pm
Alexander Ley
5 years ago Jan 26, 2017 1:02pm
Jean-Christophe Gueriaud
5 years ago Jan 26, 2017 5:04pm

Alexander Ley: I am talking about Vaadin 8, Grid and the new Java 8 Date-Time API.

I'm using a lambda expression to convert localdate to string. I think the old DateRenderer has not been migrated to Java 8.
Something like that (but a new class DateRenderer should be available)
grid.addColumn(d-> {return d.getDate().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));}).setCaption("date")).setSortProperty("date");

Alexander Ley
5 years ago Jan 27, 2017 11:49am
Jukka Nikki
5 years ago Feb 21, 2017 11:54am
Luca Pertile
4 years ago May 11, 2017 12:57pm

Hi

Which is the best practise in Vaadin8 with DateField if my backend use java.util.date?
Should I create and set converters everywhere?