|
|
@@ -8,8 +8,8 @@ import javafx.scene.Node;
|
|
|
import javafx.scene.control.*;
|
|
|
import javafx.scene.control.cell.PropertyValueFactory;
|
|
|
import javafx.scene.layout.*;
|
|
|
-import javafx.scene.paint.Color;
|
|
|
import javafx.geometry.Pos;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import space.anyi.client.App;
|
|
|
import space.anyi.client.service.AiService;
|
|
|
import space.anyi.client.service.BookService;
|
|
|
@@ -72,7 +72,7 @@ public class MainController {
|
|
|
@FXML private TableColumn<UserTransactionDTO, String> transBookTitleCol;
|
|
|
@FXML private TableColumn<UserTransactionDTO, Integer> transNumCol;
|
|
|
@FXML private TableColumn<UserTransactionDTO, BigDecimal> transPriceCol;
|
|
|
- @FXML private TableColumn<UserTransactionDTO, String> transTimeCol;
|
|
|
+ @FXML private TableColumn<UserTransactionDTO, java.time.LocalDateTime> transTimeCol;
|
|
|
@FXML private VBox transEmptyState;
|
|
|
|
|
|
// Profile tab
|
|
|
@@ -494,6 +494,19 @@ public class MainController {
|
|
|
transNumCol.setCellValueFactory(new PropertyValueFactory<>("transactionNum"));
|
|
|
transPriceCol.setCellValueFactory(new PropertyValueFactory<>("transactionPrice"));
|
|
|
transTimeCol.setCellValueFactory(new PropertyValueFactory<>("transactionTime"));
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ transTimeCol.setCellFactory(col -> new TableCell<>() {
|
|
|
+ @Override
|
|
|
+ protected void updateItem(java.time.LocalDateTime item, boolean empty) {
|
|
|
+ super.updateItem(item, empty);
|
|
|
+ if (empty || item == null) {
|
|
|
+ setText(null);
|
|
|
+ } else {
|
|
|
+ setText(item.format(formatter));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ transTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
|
|
}
|
|
|
|
|
|
@FXML
|