Forum Discussion
Setting an expiry date for published content
Glad you found it useful. 😎
Hi Owen - do you know you would hard code the variables as you mentioned above?
- OwenHolt4 years agoSuper Hero
Which variable do you wish to hard code? If it is the creation date, simply store a date value in a Storyline variable.
If you have a file you can share, I can help you troubleshoot it.- PeterWard-917e33 years agoCommunity Member
Owen Holt, would you be willing to help with some custom Java script for a Storyline course? In addition to creating an expiration date, we need to be able to set a cap on the number of users. If you're willing to assist, please contact me at peter@gilbertcreative.com. We're happy to compensate you for your time.
On another note, it's incredible that Articulate hasn't fulfilled this request after NINE YEARS! - JenniferManu6882 years agoCommunity Member
Hey Owen!
I am trying to implement this on my end, but cannot get the layers to display correctly. Would you mind taking a look at my file and seeing if I have made a mistake? I feel like I followed your template exactly, but cannot seem to get it to behave how I expect it to.
I really appreciate all your help!
Robert
- OwenHolt2 years agoSuper Hero
Your code is working fine. It looks like the problem is in the file's variables.
The start date variable is empty. It must have a default value or the JavaScript cannot calculate elapsed time. Add a value in the following format MM/DD/YYYY (for example: 03/01/2023).
Your Valid Days variable is also empty but must have a value. This is how long the course should be open in days. For example, you would use 365 for a 1 year course. Without this number, Storyline cannot compare the number of elapsed days against the number of allowed days.