From 3fa9c82add608595fca1d6f950c0698fcb9bf068 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 10 Oct 2025 09:11:14 +0200 Subject: [PATCH] Fixes #1598 Lua: Implements %u in os.date() --- client/space_lua/stdlib/os.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/space_lua/stdlib/os.ts b/client/space_lua/stdlib/os.ts index 320a9972..abd4b02a 100644 --- a/client/space_lua/stdlib/os.ts +++ b/client/space_lua/stdlib/os.ts @@ -137,6 +137,10 @@ export const osApi = new LuaTable({ // Day of the week "%A": () => date.toLocaleString("en-US", { weekday: "long" }), "%a": () => date.toLocaleString("en-US", { weekday: "short" }), + "%u": () => { + const dow = date.getDay(); + return "" + (dow === 0 ? 7 : dow); + }, "%w": () => "" + date.getDay(), // Day of the year "%j": () => {