Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nickels's avatar

VueJS Countdown timer setInterval resets date input field?

hi guys. question. hope that anyone would be able to help.

I've got a component in which i've made a countdown timer. On the data property i have defined now: null, then on the mounted hook i'm calling

        setInterval(() => {
                this.now =  Math.floor((new Date()).getTime() / 1000);
            }, 1000);

All fine and the timer works with some extra logic. however when I try to fill an input of type date with v-model to another property in the data object it resets every seconds. other input fields do not? any suggestions??

0 likes
1 reply

Please or to participate in this conversation.