Skip to main content
Participant
May 6, 2018
Question

How to create a date in the future using variables & advanced actions

  • May 6, 2018
  • 2 replies
  • 159 views

I have created a course that is a system demo. It is a scenario based course and I want to create a user variable of a realistic ship date by adding 21 days to the system date (and maintain a correct date format).  Is there a way to do this by creating a user variable and advanced actions? I don't know java script and am relatively new to Captivate.

This topic has been closed for replies.

2 replies

TLCMediaDesign
Inspiring
May 7, 2018

Create your variables in Captivate. On enter of a slide where the date is to appear, execute the script below to set the date. Note that the number in Bold is the milliseconds to add to the current date. This example uses a user defined Captivate variable futureDate_1.

var d = new Date();

var t = d.getTime();

window.futreDate_1 = new Date(t + 1209600000);

Lilybiri
Legend
May 7, 2018

I'm sorry, but although I am a big fan of advanced actions, in that case you should use JavaScript. There are no functions in Captivate's advanced/shared actions. It could be done, but will be very complicated, not worthwhile the effort.