JS: Add yearday calculation to getLocalTime and getGMTime, so that yearday is not 0 for TimeInfo instances under JS backend. (#5616)
This commit is contained in:
parent
27a291c09e
commit
875e344be0
2 changed files with 21 additions and 2 deletions
13
tests/js/ttimes.nim
Normal file
13
tests/js/ttimes.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# test times module with js
|
||||
discard """
|
||||
action: run
|
||||
"""
|
||||
|
||||
import times
|
||||
|
||||
# $ date --date='@2147483647'
|
||||
# Tue 19 Jan 03:14:07 GMT 2038
|
||||
|
||||
block yeardayTest:
|
||||
# check if yearday attribute is properly set on TimeInfo creation
|
||||
doAssert fromSeconds(2147483647).getGMTime().yearday == 18
|
||||
Loading…
Add table
Add a link
Reference in a new issue