diff --git a/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java b/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java index c4de3aa40..5af6461e6 100644 --- a/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java +++ b/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java @@ -9,6 +9,10 @@ import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; import javafx.stage.Modality; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; + public class UpdateChangelogAlert { private static boolean shown = false; @@ -35,8 +39,11 @@ public class UpdateChangelogAlert { alert.setAlertType(Alert.AlertType.NONE); alert.initModality(Modality.NONE); + var date = update.getReleaseDate() != null ? + DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM) + .format(update.getReleaseDate().atZone(ZoneId.systemDefault())) : "Latest"; var markdown = new MarkdownComp(update.getRawDescription(), s -> { - var header = " 

" + AppI18n.get("whatsNew", update.getName()) + "

"; + var header = " 

" + AppI18n.get("whatsNew", update.getName(), date) + "

"; return header + s; }) .createRegion(); diff --git a/app/src/main/java/io/xpipe/app/update/UpdateHandler.java b/app/src/main/java/io/xpipe/app/update/UpdateHandler.java index 0b480f330..09fac1f7b 100644 --- a/app/src/main/java/io/xpipe/app/update/UpdateHandler.java +++ b/app/src/main/java/io/xpipe/app/update/UpdateHandler.java @@ -227,7 +227,8 @@ public abstract class UpdateHandler { var performedUpdate = new PerformedUpdate( preparedUpdate.getValue().getVersion(), preparedUpdate.getValue().getBody(), - preparedUpdate.getValue().getVersion()); + preparedUpdate.getValue().getVersion(), + preparedUpdate.getValue().getReleaseDate()); AppCache.update("performedUpdate", performedUpdate); } }); @@ -256,6 +257,7 @@ public abstract class UpdateHandler { String name; String rawDescription; String newVersion; + Instant releaseDate; } @Value