diff options
author | Oscar NihlgÄrd <oscarnihlgard@gmail.com> | 2018-08-17 11:12:58 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-08-17 11:12:58 +0200 |
commit | 33ed8f7e73cb36f82f1abd3462364c7c02551a18 (patch) | |
tree | 46d12cd0452c70d6fe9f87b1e31fb5b043fefcfe /tests/js | |
parent | b77d910e4e21f80d42bf781b5f676c8623a06a85 (diff) | |
download | Nim-33ed8f7e73cb36f82f1abd3462364c7c02551a18.tar.gz |
times.Timezone changes (#8527)
* Use floorDiv in times.nim * New implementation of times.Timezone * Tweak doc comments * Fix typo
Diffstat (limited to 'tests/js')
-rw-r--r-- | tests/js/ttimes.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/js/ttimes.nim b/tests/js/ttimes.nim index bd599a7ae..ad7fdd211 100644 --- a/tests/js/ttimes.nim +++ b/tests/js/ttimes.nim @@ -21,17 +21,17 @@ doAssert b - a == initDuration(seconds = 500_000_000) # Because we can't change the timezone JS uses, we define a simple static timezone for testing. -proc staticZoneInfoFromUtc(time: Time): ZonedTime = +proc zonedTimeFromTime(time: Time): ZonedTime = result.utcOffset = -7200 result.isDst = false - result.adjTime = time + 7200.seconds + result.time = time -proc staticZoneInfoFromTz(adjTime: Time): ZonedTIme = +proc zonedTimeFromAdjTime(adjTime: Time): ZonedTIme = result.utcOffset = -7200 result.isDst = false - result.adjTime = adjTime + result.time = adjTime + initDuration(seconds = -7200) -let utcPlus2 = Timezone(zoneInfoFromUtc: staticZoneInfoFromUtc, zoneInfoFromTz: staticZoneInfoFromTz, name: "") +let utcPlus2 = newTimezone("", zonedTimeFromTime, zonedTimeFromAdjTime) block timezoneTests: let dt = initDateTime(01, mJan, 2017, 12, 00, 00, utcPlus2) |