Fix day of the week calculation (#1443)
This commit is contained in:
@@ -136,7 +136,7 @@ export const osApi = new LuaTable({
|
||||
// Day of the week
|
||||
"%A": () => date.toLocaleString("en-US", { weekday: "long" }),
|
||||
"%a": () => date.toLocaleString("en-US", { weekday: "short" }),
|
||||
"%w": () => "" + (date.getDay() + 1),
|
||||
"%w": () => "" + date.getDay(),
|
||||
// Day of the year
|
||||
"%j": () => {
|
||||
return dayOfYear(date).toString().padStart(3, "0");
|
||||
|
||||
@@ -20,3 +20,5 @@ assert(os.date("%U %V %W", os.time({ year = 2025, month = 1, day = 5 })) == "01
|
||||
assert(os.date("%U %V %W", os.time({ year = 2025, month = 1, day = 6 })) == "01 02 01")
|
||||
assert(os.date("%U %V %W", os.time({ year = 2025, month = 1, day = 7 })) == "01 02 01")
|
||||
assert(os.date("%U %V %W", os.time({ year = 2025, month = 5, day = 3 })) == "17 18 17")
|
||||
|
||||
assert(os.date("%w", 1750672800) == "1")
|
||||
|
||||
Reference in New Issue
Block a user