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:
Konstantin Molchanov 2017-03-29 14:36:04 +04:00 • committed by Andreas Rumpf
commit 875e344be0
2 changed files with 21 additions and 2 deletions

13
tests/js/ttimes.nim Normal file
View 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