-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Timeline Doesn't Work With Dates Before Common Era #307
Comments
Thanks, I see indeed negative years in a string date are interpreted as positive. Using javascript Dates works fine though (i.e. The date parsing is done by moment.js. I asked on stackoverflow about this behavior: |
Excellent, thank you. However, if I do as you suggest, vis.js gives me an error, saying it failed to load the object. So I must be serializing incorrectly. To make things simple, I've reduced my json data to a single event:
Can you please tell me what I am doing wrong? Thank you. |
Using timestamps: [
{
"content": "2nd Millenium BCE",
"start": -125281126800000,
"end": -93692682000000,
"id": 4
}
] or use this six number year notation I mention in the stackoverflow issue, but I don't know why this works and if that's intended: [
{
"content": "2nd Millenium BCE",
"start": "-002000-01-01",
"end": "-001000-11-31",
"id": 4
}
] |
Is this still an issue? |
Hello Guys, Can I go back 13.7 billion years ago? |
Just try it. I think it should work as long as you don't use ISODates but unix timestamps or Dates |
how would i get the unix timestamp for 13.7 billion years? |
sorry I mean a timestamp in milliseconds. Just google for how timestamps and Dates work. |
But its a very long number and vis is not going back after 2 lac 70 k |
Use negative integer. But do not forget about 32 and 64bit systems. |
Can you simply let me know how would I use 13.7 billion BC in this format I know for BC i have to use negative years of max 6 length . Now can any one of you simply let me know the figure to use in start value for plotting 13.7 billion years ago point on the timeline. |
Its impossible, can't go further than new Date(-8.64e15). |
One solution(in specific cases) is correct Timeline format. Instead of years or other time labels use custom time like 'Y billion'. |
Can you explain more on this. |
The label changing is very tricky. If you want an interactive timeline you will get the fractions of the years which will not make sense. I'd suggest @mohsincynexis should experiment a bit. This would be easier when we port the dataaxis of graph2d over to the time axis and have custom labels. Just hide the time axis and insert a datetime label to your items. |
This is just one 'backdoor'. Not in all cases it can be used. For example, your timeline consists only "big timestamps". Like 17.3 billion BC, 25 AC, 123AC ... And you do not use "small timestamps"(seconds, minutes). You can bind minutes like a years and years like billion years. var options = {
end: duration,
start: 0,
format: {
majorLabels: {
minutes: "mm years", // This is not correctly written
years: "Y,m billion years" // And this
}
}
}; This is just idea sketch but I believe it is working solution. |
We are using minutes but not seconds |
It would be a great help for me if you would post the the complete working example here please. |
You've been provided with all required information. These issues are not here to do your work for you. If you encounter problems, create a JSBin and show us the issue. |
how would it affect the date after changing the labels or do I have to make some calculations. |
It would crash and there's nothing we can do about it. Or you could just try it and see for yourself. |
Hi Imcaps, I have set the new labels but its appearing strange in the timeline like this -270007, biJun 10, -270007ion y4amr6 here is the format I am using
|
very good |
When I attempt to display a Timeline data set containing dates before the Common Era (i.e., B.C.), the results are incorrect and inconsistent, either not being displayed at all, or are displayed as though they were A.D. For example, a data set item with a start date of "-700-01-01" and end date of "-500-12-31" will either not appear, or after some zooming of and moving about of the timeline, may appear, but is rendered as though the dates were 700 and 500 A.D., not B.C.
Does Timeline not support pre-Common Era dates?
Apart from this one issue, this library suits all my needs quite nicely.
The text was updated successfully, but these errors were encountered: