Hide Button For Seven Days

I would like to hide a button for 7 to 14 days.

I have a page that will list the progress of the tasks that need to be completed. The button that opens the first task is the one that I want to hide after the task is completed. I have some people that seem to click that button just out of curiosity. The result of this curiosity is a number of orphaned items in the database.

If I can hide that button for a week or two I believe it will stop this issue. Any suggestions, would be appreciated.

Having a think about it, and not knowing your exact site/setup etc, the first thoughts that come to mind are:

  • set up a table in a DB to store the info below for the user/client
  • When the event is triggered (i.e. the task is completed), create a new DB row which uses the TIMESTAMP or NOW feature and then add 7 -14 days to that date.
  • Hide the button and have it only show when TODAYs date is greater than or equal to the new field you created in the DB which was the event date + 7-14 days

I’m not great with session storage and cache etc, so my thoughts were just to create a new DB field or table to store the info.

Hope it helps, I’m sure others will have better ideas

Thank you Phillip! I appreciate the pointers. I’ll give it a go.

Here’s what I did to test the output of hiding a button for seven days after it was clicked to create a file.

I setup some two datetime variables.

I setup the ‘now’ variable for the current date and the ‘date’ plus 7 for the seven days ahead of the created date.

Then I setup buttons that utilize the dmx-show & hide to control the buttons visibility. The dmx-show & hide is controlled by the relationship between the created date + 7 and today’s date.

Below is the result of the test. The red button illustrates when the button is hidden, and the green button is when the button is visible.