almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

Timeline with start-time or end-time not working on iPhone or IE with Win10 #2696

Closed helgphi closed 7 years ago

helgphi commented 7 years ago

Hi,

tested a few thing about json and start: "2017-02-09 10:40:00" or end:"...." at different browsers. On Firefox everything is working fine. But on Safari or Chrome at iPhone (6Plus) the Item will fix positioned on left side.

When i change the json file from "[{"id":1,"content":"Urlaub","start":"2017-02-06 11:00:00","end":"2017-02-08 11:30:00","group":17} (-> not working at iPhone, but Firefox at Windows 10) to "[{"id":1,"content":"Urlaub","start":"2017-02-06 11:00:00 pm","end":"2017-02-08 11:30:00 pm","group":17} (-> not working at iPhone and Windows 10!) So I think after this test, that my iPhone can't interpret the time after the date right (like Firefox at Windows 10 with "11:00:00 pm". With date only "[{"id":1,"content":"Urlaub","start":"2017-02-06","end":"2017-02-08","group":17}" at Windows 10 and iPhone everything is working fine...

So is this a bug or do I something wrong?

yotamberk commented 7 years ago

@helgphi a solution for this is to simply convert your time to ISOStrings. It's not a good idea in general to give time fields a non-time value

helgphi commented 7 years ago

@yotamberk ok, sorry I don't know exactly what you mean, but every change of the format: "start":"2017-02-06 11:00:00","end":"2017-02-08 11:30:00" will kill the items in the timeline. By the way, the example "Data serialization" won't work on iPhone and IE under Win10: http://visjs.org/examples/timeline/dataHandling/dataSerialization.html (when you delete the time-value and load it with the button again, then everything is working fine)

All items ar floated: left and overlayed.....so I think this is a Bug from vis or js and the interpretation of the value time....or I'm wrong?

yotamberk commented 7 years ago

@helgphi It's not great behavior... We need to solve this

bradh commented 7 years ago

It would be nice to handle any time format, but 2017-02-06 11:00:00 is not a valid javascript date. It might be accepted by some browsers, but you need to use a standard (ISOString) format if you want it to work in any browsers.

I'll try to fix the example soon.