javascript calendar for date input

Apr 26, 2019

I know something like this question has been posted before but I'm not sure anyone got a satisfactory response.

My goal is to generate on a Storyline slide the difference (in days) between today's date and an earlier date selected within the past year. I am able to successfully insert today's date using ELH's best practices and the helpful discussion here.

But as a javascript novice, I'm more perplexed about how to get the user to be able to enter a (past) date and to find the difference in days between it and the current date. It looks like there are some nice, simple out of the box date-pickers in jquery, for example, but I don't seem to be able to get them into storyline, much less output the date and code the difference between it and current date.

Keep feeling like someone must have solved this problem already, but can't find the thread. Thanks for advice any of the javascripters on here might be able to offer!

all best, Ian

3 Replies
Candice Phaneuf

I'm working on an issue like this as well! We want to assign an eLearning to someone, but we don't want them to be able to move past the first slide until they've been in the job X days. Our idea was to use a date selector for the employee to indicate their first day of work. Then a calculation would be done and they'd get 1 of 2 options:
- a layer that says oh shoot you've only been here 39 days, you can't move on just yet.
- a layer that says yahoo you've been here at least 45 days, lets continue.
Something to that effect.
How can I finagle this?

Candice Phaneuf

The item needs to be auto-assigned, not left to the employee or a manager to assign.  The LMS we have cannot assign based on prior completions or based on a specific time frame, unfortunately.  Hence us trying to figure out a way to lock down content within the module since outside of the module is not an option.