Using variables to calculate ordinal dates
Apr 28, 2014
By
Robert Noska
Hi all,
I'm working on a project for our management staff to create a timeline for their employees' review periods. I want the supervisor/manager to be able to enter the month/day/year of the start of the review period, and turn that day into an ordinal day (1-365 or 1-366 on leap years) to calculate the quarters of the review period. Ex. supervisor lists 1/1/2014 as start of review, the four quarters are calculated at 4/1/14, 7/1/14, and 10/1/14 respectively.
I know that once I have the ordinal number, I can just use variables to add 90 to the result for the quarters. My issue is converting the date to that ordinal number. Any suggestions?
Thanks!
Robert
1 Reply
You can pass the entered date into a JavaScript that calculates the ordinal day and returns that number to Storyline. For a JavaScript snippet that could be adapted see here and for some basic JavaScript examples in Storyline see here.
This discussion is closed. You can start a new discussion or contact Articulate Support.