-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The diff is updating successfully if the time passes.
The problem is that the component is not updating the human diff if the date-string changes. So the date-property is not reactive.
I think this could be solved by accessing the date property this.date directly in the getSeconds-method instead of passing it as a param out of the interval-Loop.
Proposal:
mounted() {
const interval = setInterval(() => {
this.getSeconds();
}, 1000);
this.$once('hook:destroyed', () => clearInterval(interval));
},
...
getSeconds() {
const seconds = moment().diff(moment(this.date), "seconds");
this.humanReadable = this.getDuration(seconds);
if (this.humanReadable) {
this.humanDifference = this.humanReadable.interval;
this.humanWord = this.humanReadable.humanEpoch;
}
},Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels