accommodate long date range in javascript

Wednesday, December 11, 2013

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.

I've referred this question as well.

Below is the code to test the max value in moment.js and it prints NaN on console.

<script type="text/javascript"> var now = moment(); console.log(':::now:::',now); var a = moment([-150000000, 0, 29]); var b = moment([150000000, 0, 28]); console.log(a.diff(b)); // 86400000 console.log([Number.MAX_VALUE, Number.MIN_VALUE]); var iso_date = new Date(-15000000000).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) </script>

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
For more options, visit


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