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
5 Replies
Hi Robert
What tool are you using to do this? Excel?
Hi Robert,
Probably the best way to do this is to use date.js or moment.js. They'd take most of the date calculation complexity right out of Storyline. You would have to parse and calculate entirely through JS triggers though.
Hope this helps,
Alex
Looks like you posted this question over here too.
Hi again,
Sorry about the double post, tried to delete the one in the help area.
Gayathri- I was just thinking about using variables within Storyline and manipulating them. It sounds like JavaScripting is the way to handle it.
Alexandros and Michael- Thanks for the resources, but I have had basically no exposure to JavaScript and I woulds have difficulty being able to integrate something like that into Storyline. Do you know of any basic resources that could help me get my feet wet before tackling what I'm trying to accomplish?
Thanks!
You'll find some basic JavaScript tutorials here and some info and examples for using JS with Storyline is available here.
This discussion is closed. You can start a new discussion or contact Articulate Support.