Skip to content
This repository was archived by the owner on Aug 23, 2018. It is now read-only.

Commit e61100c

Browse files
author
Joseph Hager
committed
Remove use of window object in Date and Time native modules.
1 parent 2624f2d commit e61100c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Native/Date.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Elm.Native.Date.make = function(localRuntime) {
1111

1212
function dateNow()
1313
{
14-
return new window.Date;
14+
return new Date;
1515
}
1616

1717
function readDate(str)
1818
{
19-
var date = new window.Date(str);
19+
var date = new Date(str);
2020
return isNaN(date.getTime())
2121
? Result.Err("unable to parse '" + str + "' as a date")
2222
: Result.Ok(date);
@@ -38,7 +38,7 @@ Elm.Native.Date.make = function(localRuntime) {
3838
second : function(d) { return d.getSeconds(); },
3939
millisecond: function (d) { return d.getMilliseconds(); },
4040
toTime : function(d) { return d.getTime(); },
41-
fromTime: function(t) { return new window.Date(t); },
41+
fromTime: function(t) { return new Date(t); },
4242
dayOfWeek : function(d) { return { ctor:dayTable[d.getDay()] }; }
4343
};
4444

src/Native/Time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Elm.Native.Time.make = function(localRuntime)
103103
return localRuntime.Native.Time.values = {
104104
fpsWhen: F2(fpsWhen),
105105
every: every,
106-
toDate: function(t) { return new window.Date(t); },
106+
toDate: function(t) { return new Date(t); },
107107
read: read
108108
};
109109

0 commit comments

Comments
 (0)