Skip to content

Commit 5a5bfd3

Browse files
author
BirdeeHub
committed
fix(dates): dates fixed
1 parent 84cba21 commit 5a5bfd3

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/dates.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ bool parse_toml_date(str_iter *src, TomlDate date) {
154154

155155
// Parse YYYY-MM-DD
156156
if (!parse_number(src, 4, &DATE_GET(date, YEAR))) {
157+
iter_reset_pos(src);
157158
if (!parse_time(src, date)) return false;
158159
DATE_GET(date, TOML_TYPE) = TOML_LOCAL_TIME;
159160
return true;

tests/scratch.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ do
118118
}
119119
local errtoml = [=[
120120
121+
time_now = 06:22:05
122+
time_next = 06:22:05.1234
123+
121124
# INVALID TOML DOC
122125
fruits = []
123126
database = { duplicate = { hehe = "haha" }}
@@ -126,6 +129,7 @@ do
126129
next_release = 2028-08-24T12:00:00.666Z
127130
last_backup = 2025-08-23T23:45:12-07:00
128131
last_modified = 2025-08-24 12:00:00Z
132+
date_today = 2025-08-24
129133
130134
[[fruits]]
131135
name = "apple"

0 commit comments

Comments
 (0)