[Vuejs]-Trying to compare a list of dates to current date, but it's just returning false

0👍

Are you sure you use "some" method in the right way? Your computed value is called "datesBiggerOrCurrentDate" and in a template you try to compare it to a currentDate, but this computed value is a boolean not a date because "some" method returns boolean value.

You can read about the "some" method here Array.prototype.some()

Instead using of "some" method you should use "filter" method and compare dates by built-in momentjs method – "isSameOrAfter"

Your computed value should be something like this:

datesBiggerOrCurrentDate() {
      return this.listOfDates.filter(date => moment(date).isSameOrAfter(this.currentDate));
    },

You can try it on codepen – https://codepen.io/AlekseiKrivo/pen/vYVWzzr

Leave a comment