Re: long date range in javascript

Thursday, December 12, 2013

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:

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.

Copyright © 2010 Web Design | Free Blogger Templates by Splashy Templates | Layout by Atomic Website Templates

Vida de bombeiro Recipes Informatica Humor Jokes Mensagens Curiosity Saude Video Games Animals Diario das Mensagens Eletronica Rei Jesus News Noticias da TV Artesanato Esportes Noticias Atuais Games Pets Career Religion Recreation Business Education Autos Academics Style Television Programming Motosport Humor News The Games Home Downs World News Internet Design Entertaimment Celebrities 1001 Games Doctor Pets Net Downs World Enter Jesus Mensagensr Android Rub Letras Dialogue cosmetics Genexus lasofia thebushrajr wingshock tripedes gorduravegetal dainfamia dejavu-transpersonal jsbenfica republicadasbadanas ruiherbon iranianforaryans eaystcheyl fotosdanadir Só Humor Curiosity Gifs Medical Female American Health Madeira Designer PPS Divertidas Estate Travel Estate Writing Computer Matilde Ocultos Matilde futebolcomnoticias girassol lettheworldturn topdigitalnet Bem amado enjohnny produceideas foodasticos cronicasdoimaginario downloadsdegraca compactandoletras newcuriosidades blogdoarmario arrozinhoii