Invalid time value for starting date with Safari #1738
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#1738
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello
I'm using the latest release of vikunja api (1.4.0) and front end (2 days agos) for linux-arm and when i try to set a starting date on a task with Safari browser it shows me an invalide time value error. I can reproduce this issue on the Demotoo but for both my local an demo Vikunja i have no issue with Chrome.
Since i use Vikunja on an Iphone which works mainly with Safari it could be a bit problematic to describe a task using dates features solely on my phone.
My Chrome and Safari browser are in French settings and ma raspberry pi system is in english settings.
I can't reproduce this either on Firefox Desktop but I can't add a due date at all on mobile (either firefox or chrome) on Android. This might be related, I'll investigate a bit once I get my hands on an ios device.
I can confirm this is still a problem, but only on iOS. Unfortunately I don't own a mac, looking into browserstack now to get a remote debug shell so that I can better debug this.
I can reproduce this problem on iOS and Safari.
@bochachaner Would you be able to add a bit of debug logging and build the frontend on your machine to get more information about the erros?
I still don't have access to a mac, so I'm unable to check this.
I think safari is not able to handle new Date("2021-01-05 12:00")
Not sure if it is really -> "dateFormat: 'Y-m-dTH:i'" in Datepicker.
or if the string shall be splitted:
Looks like this is the problem: https://stackoverflow.com/q/4310953/10924593
I think this could cause a whole heap of issues since flatpickr (the day/month/year selector of the datepicker) requires the date to have the format
YYYY-MM-DD
IIRC.This is probably also a problem in multiple places and should be fixed in multiple places. Reminders shouldn't work either, could you check? Same for due dates and end dates.
Could you add something like
in
src/components/input/datepicker.vue:171
andsrc/components/input/datepicker.vue:174
(before thenew Date()
part to see what gets passed to the function? In the case of task dates, these should already be a proper js date.If it is failing before, could you add logging in
src/models/task.js:8
(before the dates get parsed from the api)?solved the problem on safari (os x / ios) and also works fine on chrome.
This seems also kind of relevant: https://github.com/date-fns/date-fns/issues/2130
I finally got access to browserstack so I could debug this a bit.
It looks like this is caused by flatpickrs date format: Safari can't handle something like
2021-02-03 09:00
, but the other browsers can.A real iso date like
2021-02-06T12:00:00+01:00
on the other hand works perfectly.I'm trying to implement a fix with this: https://stackoverflow.com/a/5646753/10924593
@bochachaner I'd prefer that over your solution since I feel like it is a slightly simpler. But yours definitely pointed me in the right direction.
Fixed in
be92db49a9
- feel free to reopen if you find the issue persists.