Back to Browse

How to Pull Current Date in Articulate Storyline [Using JavaScript]

5.1K views
Nov 13, 2022
12:59

Using JavaScript inside of Articulate Storyline gives you extended features and capabilities. You can create custom animations, detect the user's operating system, and more. One of the cool things you can do is detect the current date and time the user is taking your course and then change content based on the date. In this example, I walk you through how to pull the date and format it to display to the user. I also show you how to isolate the month and then change a state of a Storyline object depending on the month. So you can modify things in your training like backgrounds or variable information to personalize content based on when the learner is taking the course. All it takes is the simple code snippet below and some logic inside Storyline. Check it out. let currentTime = new Date(); let month = currentTime.getMonth() + 1; let day = currentTime.getDate(); let year = currentTime.getFullYear(); // Putting it together let dateString = month + "/" + day + "/" + year; //Pushing data to Storyline let player = GetPlayer(); player.SetVar("todaysDate", dateString); player.SetVar("month", month); *🥷 Link to Full Courses* Create Custom eLearning w/ Claude Code: https://www.learningdojo.ninja/courses/early-bird-discount-creating-custom-elearning-courses-with-claude-code Articulate Storyline 360: https://www.learningdojo.ninja/courses/create-elearning-courses-with-articulate-storyline-360 Storyline & JavaScript: https://www.learningdojo.ninja/courses/javascript-articulate-storyline-360 Vibe Coding Fundamentals: https://www.learningdojo.ninja/courses/vibe-coding-fundamentals AI Development in Articulate Storyline: https://www.learningdojo.ninja/courses/ai-development-with-articulate-storyline xAPI Fundamentals: https://www.learningdojo.ninja/courses/xapi-fundamentals-course Camtasia: https://www.learningdojo.ninja/courses/mastering-camtasia Articulate Rise 360: https://www.learningdojo.ninja/courses/create-responsive-html5-elearning-with-articulate-360-rise If you would like learn more visit https://learningdojo.ninja.

Download

0 formats

No download links available.

How to Pull Current Date in Articulate Storyline [Using JavaScript] | NatokHD