0618f5cf00
Signed-off-by: laurimaaninka <lauri.maaninka@gmail.com>
23 lines
767 B
Java
23 lines
767 B
Java
package fi.lpam.ruokamanageri.gui.tableCell;
|
|
|
|
import fi.lpam.ruokamanageri.dataluokat.RaporttiRivi;
|
|
import javafx.scene.control.TableCell;
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
/**
|
|
* Kustomoitu TableCell, joka päivitäTietokantaan sen sisältämän LocalDaten muotoon dd.MM.yyyy
|
|
*/
|
|
public class PaivamaaraTableCell extends TableCell<RaporttiRivi, LocalDate> {
|
|
public PaivamaaraTableCell() {}
|
|
|
|
@Override
|
|
protected void updateItem(LocalDate aika, boolean empty) {
|
|
super.updateItem(aika, empty);
|
|
if (empty || aika == null) return;
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
|
|
String muokattuAika = aika.format(formatter);
|
|
setText(muokattuAika);
|
|
}
|
|
} |