A
A
Amenov_Abdul2019-08-07 13:30:14
Vue.js
Amenov_Abdul, 2019-08-07 13:30:14

How to track the date?

Hello!
I can't figure out how to do the following task:
There is a list of tenders, and each has an end date, I need to automatically hide the tender when the end date has come. No reboot.
I did it like this: v-if="new Date() < new Date(tender.date_end)" but it doesn't work like that... I tried using computed. Also not that. Apparently I don't understand how it works.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael, 2019-08-07
@Amenov_Abdul

tenders = [
  {
    isActive: true,
    date: дата
  }
]

in mounted or created, set setInterval and check the date of tenders every second, and set a flag that it is not active

A
Anton, 2019-08-07
@Eridani

https://jsfiddle.net/az9tvyqs/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question