@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user