You should be able to use a combination of getDate and setDate, or getDate and add 7 days, in js, unless Vue has a library for downloading. I probably wouldn't want a library just for that one thing.
Aug 14, 2020
2
Level 17
Show an element if date is before or after another date
I'm using vue to dynamically show elements (called boxes) on the page, but I need to display an element based on if it's start date is before or after today+1 week.
So if the box.start_date is before one week from today, then show it, else hide it.
I'm not sure how I can do this in vue
ie.
<div class="box" v-if="box.start_date < *** 1 week from now date here?? ***"> ... </div>
I tried using moments.js but it give me an error saying moments is not defined in vue
With laravel and blade I would just do this like this...
@if($box->start_date > now()->addWeek(1))
How can I make this work with vue?
Please or to participate in this conversation.