package fi.lpam.gui.tableCell; import fi.lpam.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 { 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); } }