Skip to content

Commit 7413089

Browse files
committed
fix: use correct os.time fields
1 parent 7f6720b commit 7413089

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lua/crates/time.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function DateTime.parse_rfc_3339(str)
3131
month = tonumber(month),
3232
day = tonumber(day),
3333
hour = h,
34-
minute = m,
35-
second = tonumber(second),
34+
min = m,
35+
sec = tonumber(second),
3636
}))
3737
end
3838

teal/crates/time.tl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ function DateTime.parse_rfc_3339(str: string): DateTime
2727
m = tonumber(minute) - tonumber(offset_minute)
2828
end
2929
return DateTime.new(os.time {
30-
year = tonumber(year),
31-
month = tonumber(month),
32-
day = tonumber(day),
33-
hour = h,
34-
minute = m,
35-
second = tonumber(second),
30+
year = tonumber(year) as integer,
31+
month = tonumber(month) as integer,
32+
day = tonumber(day) as integer,
33+
hour = h as integer,
34+
min = m as integer,
35+
sec = tonumber(second) as integer,
3636
})
3737
end
3838

0 commit comments

Comments
 (0)