mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: fix hour 0 parsing, remove unused function (#18897)
This commit is contained in:
@ -221,13 +221,13 @@ fn test_parse_format() {
|
||||
assert t.year == 2018 && t.month == 11 && t.day == 27 && t.hour == 12 && t.minute == 48
|
||||
&& t.second == 20
|
||||
|
||||
s = '18-1-2 1:8:2'
|
||||
s = '18-1-2 0:8:2'
|
||||
t = time.parse_format(s, 'YY-M-D H:m:s') or {
|
||||
eprintln('> failing format: ${s} | err: ${err}')
|
||||
assert false
|
||||
return
|
||||
}
|
||||
assert t.year == 2018 && t.month == 1 && t.day == 2 && t.hour == 1 && t.minute == 8
|
||||
assert t.year == 2018 && t.month == 1 && t.day == 2 && t.hour == 0 && t.minute == 8
|
||||
&& t.second == 2
|
||||
|
||||
// This should always fail, because we test if M and D allow for a 01 value which they shouldn't
|
||||
|
Reference in New Issue
Block a user