So, I have a button in a template that appears with a helper function defined with {{#if helper}} which is linked to a DB field which is related to another method etc…
What I want to do is that I want that button to appear with a delay. Of course JS/JQ way of doing it is with a timer. But I know I’m going to need this a lot in the future and I want to learn and implement the most ideal Meteor way. Not a dirty counter or setTimeOut please .
Thing is, the delay is a matter of days; not seconds. Therefore it must be a backend solution I believe (no??).
Another tip is that the helper I’m using to detect the field (with if exists) stores the date of the field’s creation as data, with new Date(). So I can use that date there to track and show that button if the date now is at least, say, 3 days after that registered date.
So, I’d say I need to:
Get the date now,
Compare with the registered date in the field,
Write a function that includes a variable (var delayTime = 3 days) to run the function accordingly.