Calculate correct yearday in times.parse
This commit is contained in:
parent
006207742f
commit
68680a9880
1 changed files with 5 additions and 2 deletions
|
|
@ -1248,8 +1248,11 @@ proc parse*(value, layout: string): TimeInfo =
|
||||||
else:
|
else:
|
||||||
parseToken(info, token, value, j)
|
parseToken(info, token, value, j)
|
||||||
token = ""
|
token = ""
|
||||||
# Reset weekday as it might not have been provided and the default may be wrong
|
# Reset weekday (might not have been provided and the default may be wrong)
|
||||||
info.weekday = getLocalTime(toTime(info)).weekday
|
# and yearday (is never provided directly and therefore probably wrong)
|
||||||
|
let processed = getLocalTime(toTime(info))
|
||||||
|
info.weekday = processed.weekday
|
||||||
|
info.yearday = processed.yearday
|
||||||
return info
|
return info
|
||||||
|
|
||||||
# Leap year calculations are adapted from:
|
# Leap year calculations are adapted from:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue