mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
Made times.nim compile again to JS
This commit is contained in:
@@ -671,13 +671,12 @@ elif defined(JS):
|
||||
|
||||
proc toTime*(timeInfo: TimeInfo): Time =
|
||||
result = internGetTime()
|
||||
result.setSeconds(timeInfo.second)
|
||||
result.setMinutes(timeInfo.minute)
|
||||
result.setHours(timeInfo.hour)
|
||||
result.setMonth(ord(timeInfo.month))
|
||||
result.setFullYear(timeInfo.year)
|
||||
result.setDate(timeInfo.monthday)
|
||||
result = result + initInterval(seconds=timeInfo.timezone)
|
||||
result.setSeconds(timeInfo.second + timeInfo.timezone)
|
||||
|
||||
proc `$`(timeInfo: TimeInfo): string = return $(toTime(timeInfo))
|
||||
proc `$`(time: Time): string = return $time.toLocaleString()
|
||||
|
||||
Reference in New Issue
Block a user