Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
1bc2da6a
Commit
1bc2da6a
authored
Aug 22, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JIO.util.deepClone changed to fixed an unknown Firefox date problem.
parent
8f8d444c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/jio/core/util.js
src/jio/core/util.js
+8
-1
No files found.
src/jio/core/util.js
View file @
1bc2da6a
...
...
@@ -63,7 +63,14 @@ function deepClone(object) {
// returns `"Invalid Date"` but in browsers it returns `null`. In
// browsers, give `null` as parameter to `new Date()` doesn't return an
// invalid date.
return
new
Date
(
object
);
// Clonning date with `return new Date(object)` make problems on Firefox.
// I don't know why... (Tested on Firefox 23)
if
(
isFinite
(
object
.
getTime
()))
{
return
new
Date
(
object
.
toJSON
());
}
return
new
Date
(
"
Invalid Date
"
);
}
// clone serializable objects
if
(
typeof
object
.
toJSON
===
'
function
'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment