修复游戏版本时间显示 1970 年:createdAt 按 Unix 秒换算成毫秒

- 写入侧真实单位是 Unix 秒:project/manifest.rs 的 GameIterationVersion.created_at 赋值为 unix_timestamp(),该函数返回 duration.as_secs()
- formatIterationVersionLabel 原来把秒值直接交给 new Date(),被当成毫秒解释,真机因此显示 1970/1/22(1788075047 毫秒 = 1970/1/22 00:41:15,与截图逐秒吻合)
- 显示侧改为 new Date(version.createdAt * 1000),与 ResourceAssetDeleteDialog 和待确认资源编辑创建时间标签的既有秒口径一致
- 给 GameIterationVersion.createdAt 补契约注释,写明单位是 Unix 秒及换算要求,避免后续再按毫秒消费
- resourceCanvasVersionBindingModel 夹具由毫秒改为真实秒值,并用真机取值 1788075047 补断言:年月日必须是 2026/8/30 而不是 1970
- resourceVersionSwitch 夹具同步改为真实秒值,避免继续沿用误导性的毫秒夹具
This commit is contained in:
2026-09-10 21:00:54 +08:00
parent dde860716e
commit 14d1635858
4 changed files with 53 additions and 8 deletions
@@ -767,6 +767,13 @@ export interface GameIterationVersion {
projectRevision: number;
resourceBindings: GameIterationVersionResourceBinding[];
createdReason: GameIterationVersionCreatedReason;
/**
* 创建时间,单位是 **Unix 秒**。
*
* 写入侧为 `project/manifest.rs` 的 `created_at: unix_timestamp()`,该函数返回
* `duration.as_secs()`,全仓版本条目统一按秒落盘。渲染时必须换算成毫秒
* (`new Date(createdAt * 1000)`),不要把秒值直接交给 `Date`。
*/
createdAt: number;
editPrompt?: string | null;
}