TypeError: dateString.includes is not a function #1784

Closed
opened 2021-04-22 11:37:15 +00:00 by andreymal · 1 comment
Contributor

When I select "Due Date" and click "Today", Vikunja throws this error:

Error in callback for watcher "value": "TypeError: dateString.includes is not a function"

found in

---> <Datepicker> at src/components/input/datepicker.vue
       <TaskDetailView> at src/views/tasks/TaskDetailView.vue
         <TaskDetailViewModal> at src/views/tasks/TaskDetailViewModal.vue
           <List> at src/views/list/views/List.vue
             <ShowList> at src/views/list/ShowList.vue
               <ContentAuth> at src/components/home/contentAuth.vue
                 <App> at src/App.vue
                   <Root>

TypeError: dateString.includes is not a function
    createDateFromString createDateFromString.js:10
    value datepicker.vue:172
    VueJS 11
    callback datepicker.vue:243
    VueJS 4
    onInput vue-flatpickr.min.js:1
    VueJS 5
    onInput vue-flatpickr.min.js:1
    VueJS 3
    triggerEvent flatpickr.js:2442
    setDate flatpickr.js:2290
    value vue-flatpickr.min.js:1
    VueJS 11
    setDate datepicker.vue:216
    click datepicker.vue:41
    click datepicker.vue:42
    VueJS 19

This is because dateString (newVal) is actually a Date object, not a string:

But I'm not a Vue expert and don't know why is this a Date object, so I just leave this issue here

When I select "Due Date" and click "Today", Vikunja throws this error: ``` Error in callback for watcher "value": "TypeError: dateString.includes is not a function" found in ---> <Datepicker> at src/components/input/datepicker.vue <TaskDetailView> at src/views/tasks/TaskDetailView.vue <TaskDetailViewModal> at src/views/tasks/TaskDetailViewModal.vue <List> at src/views/list/views/List.vue <ShowList> at src/views/list/ShowList.vue <ContentAuth> at src/components/home/contentAuth.vue <App> at src/App.vue <Root> TypeError: dateString.includes is not a function createDateFromString createDateFromString.js:10 value datepicker.vue:172 VueJS 11 callback datepicker.vue:243 VueJS 4 onInput vue-flatpickr.min.js:1 VueJS 5 onInput vue-flatpickr.min.js:1 VueJS 3 triggerEvent flatpickr.js:2442 setDate flatpickr.js:2290 value vue-flatpickr.min.js:1 VueJS 11 setDate datepicker.vue:216 click datepicker.vue:41 click datepicker.vue:42 VueJS 19 ``` This is because `dateString` (`newVal`) is actually a Date object, not a string: ![](https://i.imgur.com/Duwwq2W.png) But I'm not a Vue expert and don't know why is this a Date object, so I just leave this issue here
Owner

Fixed in 12b8d47a79

The error didn't really have any bad effect, the fix makes the error message go away.

Fixed in https://kolaente.dev/vikunja/frontend/commit/12b8d47a79d06c84c0c4ff53b73d0d111cba77f7 The error didn't really have any bad effect, the fix makes the error message go away.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1784
No description provided.