Skip to content

How do I reset timeago on click? #2254

Answered by hafiidz
hafiidz asked this question in Q&A
Discussion options

You must be logged in to vote

Urgh, just after I submitted the question, and an idea came to mind, was considering to delete this but maybe somebody else might want similar info later. I manage to get it working as follows:

let stamp = ref(Date.now());
let timeAgo = useTimeAgo(stamp);

const updateServerStatus = () => {
  console.log(Date.now());
  stamp.value = Date.now();
  timeAgo = useTimeAgo(stamp);

  checkServer();
`};`

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hafiidz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant