I have this pug file which I want to compare the system date with the date in the object using VueJs.
This is what I have. I have print the system date using this line div #{new Date()} which output Mon Oct 18 2021 10:46:39 GMT+0800 (Malaysia Time)
I have also print the date using this vue syntax div {{event.details.meta.date}} which output 2021-10-17
The question is how do I convert this date from string to datatype and then compare it to the system date?
I tried with div #{new Date("event.details.meta.date")} but the output is Invalid date
I tried div(v-if="isEventActive(event.details.meta.date)")
and
computed: {
isEventActive(_eventDate) {
var eventDate = new Date(_eventDate);
return new Date() < eventDate;
},
}
But it says isEventActive is not a function