Date render in data-table and new Date() is not working in IE11 & SafariJavaScript: Which browsers support parsing of ISO-8601 Date String with Date.parseJavaScript split function not working in IEnew Date(“YYYY/MM”) not work on IE 11Date constructor returns NaN in IE, but works in Firefox and Chromejavascript date works in all browsers except iPhone/iPod TouchSending multipart/formdata with jQuery.ajaxHow does data binding work in AngularJS?Javascript + Date conversion in IE8 and Safarinew Date(year,month,day) works differently in ie10 and ie11 Dates near DST change sometimes have a time valueJavaScript new Date() Returning NaN in IE, Safarithis keyword is not working in $.each array - IE11Javascript code runs on IE11 but not on Safari and Chromemoment js diff function is failing in firefox and safari, but works fine in chrome
Old short story where the future emperor of the galaxy is taken for a tour around Earth
Did the Shuttle's rudder or elevons operate when flown on its carrier 747?
As a DM, how to avoid unconscious metagaming when dealing with a high AC character?
Can I activate an iPhone without an Apple ID?
3D-Plot with an inequality condition for parameter values
Can someone explain this logical statement?
Could the crash sites of the Apollo 11 and 16 LMs be seen by the LRO?
(algebraic topology) question about the cellular approximation theorem
How long do Apple retain notifications to be pushed to iOS devices until they expire?
What is the closed form of the following recursive function?
Adding a vertical line at the right end of the horizontal line in frac
Why linear regression uses "vertical" distance to the best-fit-line, instead of actual distance?
Does entangle require vegetation?
Postgresql numeric and decimal is automatically rounding off
Getting fresh water in the middle of hypersaline lake in the Bronze Age
What impact would a dragon the size of Asia have on the environment?
Absconding a company after 1st day of joining
Will it hurt my career to work as a graphic designer in a startup for beauty and skin care?
What caused Windows ME's terrible reputation?
How would someone destroy a black hole that’s at the centre of a planet?
how to generate correct single and double quotes in tex
Why hasn't the U.S. government paid war reparations to any country it attacked?
Why use null function instead of == []
Are there any double stars that I can actually see orbit each other?
Date render in data-table and new Date() is not working in IE11 & Safari
JavaScript: Which browsers support parsing of ISO-8601 Date String with Date.parseJavaScript split function not working in IEnew Date(“YYYY/MM”) not work on IE 11Date constructor returns NaN in IE, but works in Firefox and Chromejavascript date works in all browsers except iPhone/iPod TouchSending multipart/formdata with jQuery.ajaxHow does data binding work in AngularJS?Javascript + Date conversion in IE8 and Safarinew Date(year,month,day) works differently in ie10 and ie11 Dates near DST change sometimes have a time valueJavaScript new Date() Returning NaN in IE, Safarithis keyword is not working in $.each array - IE11Javascript code runs on IE11 but not on Safari and Chromemoment js diff function is failing in firefox and safari, but works fine in chrome
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
My code is using datatable in which i use render date function it works in chrome but it shows NaN in IE11 & Safari. Pls help me how to resolve this issue
Here is my code snippet
Datatable
"data": 'starttime',
"render": function (data)
var date = new Date(data);
var month = date.getMonth() + 1;
return (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
Js code
var date = new Date(driver_data[i].starttime);
var month = date.getMonth() + 1;
ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
javascript jquery
|
show 5 more comments
My code is using datatable in which i use render date function it works in chrome but it shows NaN in IE11 & Safari. Pls help me how to resolve this issue
Here is my code snippet
Datatable
"data": 'starttime',
"render": function (data)
var date = new Date(data);
var month = date.getMonth() + 1;
return (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
Js code
var date = new Date(driver_data[i].starttime);
var month = date.getMonth() + 1;
ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
javascript jquery
What is your date format ?? See stackoverflow.com/questions/43316829/…
– Shree
Mar 26 at 6:39
@Shree this the date which i get from server "2019-03-18T12:30:00.000+0530"
– Tamara
Mar 26 at 6:43
Just give date without time like2019-03-18
and it's fine.
– Shree
Mar 26 at 6:50
@Shree i get this date from api response & i want to display date & time both as per requirement. I tried with using .replace(///g, "-"), but not working
– Tamara
Mar 26 at 6:52
So you need to split date and time and hold that on some variable and pass only date part for new date and concatenate again for final result.
– Shree
Mar 26 at 6:56
|
show 5 more comments
My code is using datatable in which i use render date function it works in chrome but it shows NaN in IE11 & Safari. Pls help me how to resolve this issue
Here is my code snippet
Datatable
"data": 'starttime',
"render": function (data)
var date = new Date(data);
var month = date.getMonth() + 1;
return (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
Js code
var date = new Date(driver_data[i].starttime);
var month = date.getMonth() + 1;
ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
javascript jquery
My code is using datatable in which i use render date function it works in chrome but it shows NaN in IE11 & Safari. Pls help me how to resolve this issue
Here is my code snippet
Datatable
"data": 'starttime',
"render": function (data)
var date = new Date(data);
var month = date.getMonth() + 1;
return (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
Js code
var date = new Date(driver_data[i].starttime);
var month = date.getMonth() + 1;
ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();
javascript jquery
javascript jquery
asked Mar 26 at 6:34
TamaraTamara
165 bronze badges
165 bronze badges
What is your date format ?? See stackoverflow.com/questions/43316829/…
– Shree
Mar 26 at 6:39
@Shree this the date which i get from server "2019-03-18T12:30:00.000+0530"
– Tamara
Mar 26 at 6:43
Just give date without time like2019-03-18
and it's fine.
– Shree
Mar 26 at 6:50
@Shree i get this date from api response & i want to display date & time both as per requirement. I tried with using .replace(///g, "-"), but not working
– Tamara
Mar 26 at 6:52
So you need to split date and time and hold that on some variable and pass only date part for new date and concatenate again for final result.
– Shree
Mar 26 at 6:56
|
show 5 more comments
What is your date format ?? See stackoverflow.com/questions/43316829/…
– Shree
Mar 26 at 6:39
@Shree this the date which i get from server "2019-03-18T12:30:00.000+0530"
– Tamara
Mar 26 at 6:43
Just give date without time like2019-03-18
and it's fine.
– Shree
Mar 26 at 6:50
@Shree i get this date from api response & i want to display date & time both as per requirement. I tried with using .replace(///g, "-"), but not working
– Tamara
Mar 26 at 6:52
So you need to split date and time and hold that on some variable and pass only date part for new date and concatenate again for final result.
– Shree
Mar 26 at 6:56
What is your date format ?? See stackoverflow.com/questions/43316829/…
– Shree
Mar 26 at 6:39
What is your date format ?? See stackoverflow.com/questions/43316829/…
– Shree
Mar 26 at 6:39
@Shree this the date which i get from server "2019-03-18T12:30:00.000+0530"
– Tamara
Mar 26 at 6:43
@Shree this the date which i get from server "2019-03-18T12:30:00.000+0530"
– Tamara
Mar 26 at 6:43
Just give date without time like
2019-03-18
and it's fine.– Shree
Mar 26 at 6:50
Just give date without time like
2019-03-18
and it's fine.– Shree
Mar 26 at 6:50
@Shree i get this date from api response & i want to display date & time both as per requirement. I tried with using .replace(///g, "-"), but not working
– Tamara
Mar 26 at 6:52
@Shree i get this date from api response & i want to display date & time both as per requirement. I tried with using .replace(///g, "-"), but not working
– Tamara
Mar 26 at 6:52
So you need to split date and time and hold that on some variable and pass only date part for new date and concatenate again for final result.
– Shree
Mar 26 at 6:56
So you need to split date and time and hold that on some variable and pass only date part for new date and concatenate again for final result.
– Shree
Mar 26 at 6:56
|
show 5 more comments
2 Answers
2
active
oldest
votes
Older versions of Safari, IE do not support parsing of ISO format string dates and therefore you are getting the NaN
errors. You could implement your own parsers or just use moment.js library which makes it a whole lot easier.
"data": 'starttime',
"render": function (data)
return moment(data).format("MM/DD/YYYY-hh:mm");
Here are more ways to format
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
Its done, thanks
– Tamara
Mar 26 at 8:33
add a comment |
Try this
"title": "D.O.B",
"data": "dob",
"render": function (data)
var d = new Date(data),
month = d.getMonth() + 1,
day = d.getDate(),
year = d.getFullYear(),
hour = d.getHours(),
minutes = d.getMinutes(),
seconds = d.getSeconds();
return day + ' – ' + month + ' – ' + year + ' ' + hour + ':' + minutes + ':' + seconds;
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351091%2fdate-render-in-data-table-and-new-date-is-not-working-in-ie11-safari%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Older versions of Safari, IE do not support parsing of ISO format string dates and therefore you are getting the NaN
errors. You could implement your own parsers or just use moment.js library which makes it a whole lot easier.
"data": 'starttime',
"render": function (data)
return moment(data).format("MM/DD/YYYY-hh:mm");
Here are more ways to format
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
Its done, thanks
– Tamara
Mar 26 at 8:33
add a comment |
Older versions of Safari, IE do not support parsing of ISO format string dates and therefore you are getting the NaN
errors. You could implement your own parsers or just use moment.js library which makes it a whole lot easier.
"data": 'starttime',
"render": function (data)
return moment(data).format("MM/DD/YYYY-hh:mm");
Here are more ways to format
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
Its done, thanks
– Tamara
Mar 26 at 8:33
add a comment |
Older versions of Safari, IE do not support parsing of ISO format string dates and therefore you are getting the NaN
errors. You could implement your own parsers or just use moment.js library which makes it a whole lot easier.
"data": 'starttime',
"render": function (data)
return moment(data).format("MM/DD/YYYY-hh:mm");
Here are more ways to format
Older versions of Safari, IE do not support parsing of ISO format string dates and therefore you are getting the NaN
errors. You could implement your own parsers or just use moment.js library which makes it a whole lot easier.
"data": 'starttime',
"render": function (data)
return moment(data).format("MM/DD/YYYY-hh:mm");
Here are more ways to format
answered Mar 26 at 8:21
deviprsddeviprsd
3033 silver badges11 bronze badges
3033 silver badges11 bronze badges
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
Its done, thanks
– Tamara
Mar 26 at 8:33
add a comment |
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
Its done, thanks
– Tamara
Mar 26 at 8:33
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
how i use moment in code "var date = new Date(driver_data[i].starttime); var month = date.getMonth() + 1; ps = (month.length > 1 ? month : "0" + month) + "/" + date.getDate() + "/" + date.getFullYear() + " - " + date.getHours() + ":" + date.getMinutes();"
– Tamara
Mar 26 at 8:30
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
@Tamara use the library, momentjs.com/docs/#/use-it/browser
– deviprsd
Mar 26 at 8:31
Its done, thanks
– Tamara
Mar 26 at 8:33
Its done, thanks
– Tamara
Mar 26 at 8:33
add a comment |
Try this
"title": "D.O.B",
"data": "dob",
"render": function (data)
var d = new Date(data),
month = d.getMonth() + 1,
day = d.getDate(),
year = d.getFullYear(),
hour = d.getHours(),
minutes = d.getMinutes(),
seconds = d.getSeconds();
return day + ' – ' + month + ' – ' + year + ' ' + hour + ':' + minutes + ':' + seconds;
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
add a comment |
Try this
"title": "D.O.B",
"data": "dob",
"render": function (data)
var d = new Date(data),
month = d.getMonth() + 1,
day = d.getDate(),
year = d.getFullYear(),
hour = d.getHours(),
minutes = d.getMinutes(),
seconds = d.getSeconds();
return day + ' – ' + month + ' – ' + year + ' ' + hour + ':' + minutes + ':' + seconds;
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
add a comment |
Try this
"title": "D.O.B",
"data": "dob",
"render": function (data)
var d = new Date(data),
month = d.getMonth() + 1,
day = d.getDate(),
year = d.getFullYear(),
hour = d.getHours(),
minutes = d.getMinutes(),
seconds = d.getSeconds();
return day + ' – ' + month + ' – ' + year + ' ' + hour + ':' + minutes + ':' + seconds;
Try this
"title": "D.O.B",
"data": "dob",
"render": function (data)
var d = new Date(data),
month = d.getMonth() + 1,
day = d.getDate(),
year = d.getFullYear(),
hour = d.getHours(),
minutes = d.getMinutes(),
seconds = d.getSeconds();
return day + ' – ' + month + ' – ' + year + ' ' + hour + ':' + minutes + ':' + seconds;
edited Mar 26 at 7:33
answered Mar 26 at 7:09


KarthikKarthik
11 silver badge2 bronze badges
11 silver badge2 bronze badges
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
add a comment |
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
Not working, its showing Nan In IE & safari
– Tamara
Mar 26 at 7:37
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
The code which I shared is working fine in IE & safari, I think you need to check the Date format properly
– Karthik
Mar 26 at 8:21
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351091%2fdate-render-in-data-table-and-new-date-is-not-working-in-ie11-safari%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is your date format ?? See stackoverflow.com/questions/43316829/…
– Shree
Mar 26 at 6:39
@Shree this the date which i get from server "2019-03-18T12:30:00.000+0530"
– Tamara
Mar 26 at 6:43
Just give date without time like
2019-03-18
and it's fine.– Shree
Mar 26 at 6:50
@Shree i get this date from api response & i want to display date & time both as per requirement. I tried with using .replace(///g, "-"), but not working
– Tamara
Mar 26 at 6:52
So you need to split date and time and hold that on some variable and pass only date part for new date and concatenate again for final result.
– Shree
Mar 26 at 6:56