By implementing your own custom perpetual calendar.
-- As you have found, the Date object built into JavaScript wasn't intended to support all time.
On Wednesday, December 11, 2013 4:46:12 AM UTC-5, Chako Pakodi wrote:
On Wednesday, December 11, 2013 4:46:12 AM UTC-5, Chako Pakodi wrote:
I am going to build a timeline with drag-n-drop functionality. Drag-n-drop works fine for me in IE, Chrome, FF and Safari. Now for a timeline there is a range from -15x10^9 to 15x10^9. I've tried to customize timeline.js and d3.js to fit this range. But after 10^6 it gives an error of NaN.
Below is the code to test the max value in moment.js and it prints NaN on console.
var iso_date = new Date(15000).toISOString();
console.log(':::iso_date:::',iso_date ); //1969-07-11T09:20:00.000Z
var string_date = new Date(-15000000000).toString();
console.log(':::string_date:::' ,string_date); //Fri Jul 11 1969 14:50:00 GMT+0530 (India Standard Time)
How do I accommodate this range in javascript and display it on a timeline ?????
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.