Use Current Date to Trigger Action

hplrsmom
Community Member Posts: 31
Greetings! I created a page with 12 images representing each month in a year. They will animate in as audio narration is playing. I could just animate them in one at a time starting with January, but it would be cool to start the graphic on the month that the course is accessed. So if it's accessed today, the first month to appear would be August, then populate through July. As a test, I created an OnShow action to show the August graphic if variable CurrentDate contained August. I also tried <August>. When those didn't work, I created a hidden text box to contain the current date and a ChangeContents action to update it with CurrentDate. None of these worked.
Once I determine that I can do that, I need to figure out the best way to trigger the proper order regardless of the month. My thought is to create one action group for each month that plays the images in order, then use the OnShow Action to determine which one to play. My concern is that it might take a long time to process that calculation. I'm open to ideas.
Once I determine that I can do that, I need to figure out the best way to trigger the proper order regardless of the month. My thought is to create one action group for each month that plays the images in order, then use the OnShow Action to determine which one to play. My concern is that it might take a long time to process that calculation. I'm open to ideas.
Comments
-
There seems to be a bug with the conditions panel... CurrentDate today contains "17.08.2017" (may be different where you are). If I check whether it contains "08" it works fine, only it would be true for "08.12.2017" as well. If I check for ".08" to make sure it can only be the month it won't work. It seems any "." in the value field breaks the code. CurrentDate equal to "17.08.2017" is not firing the action.
I attached a sample in that I'm using a tiny bit of custom javascript to check which month we currently have, but most of it is pure Lectora. -
Interesting. For me, CurrentDate displays "Thursday, August 8, 2017". I'm guessing the value is based on the Windows default format for Long Date, but I haven't tested to confirm.
In any case, once using JavaScript you can just use the JS Date() object as Tim as done. Alternatively, if there's some benefit to using Lectora's CurrentDate instead (I don't see one, but I wouldn't rule it out), this works:var dt = new Date(VarCurrentDate.value);
Categories
- 4.7K All Categories
- 3 New Feature Releases
- The Training Arcade®
- Arcadesâ„¢
- 56 ✫ Announcements
- 6 ✪ Contests
- 34.1K eLearning Brothers® Products
- 33.6K Lectora®
- 31.6K Lectora Discussions
- 1.9K Lectora Feature Requests
- 64 Lectora User Groups
- 16 Asset Library
- 10 AssetLibrary Discussions
- 6 AssetLibrary Feature Requests
- 286 CenarioVR®
- 166 CenarioVR Discussions
- 120 CenarioVR Feature Requests
- 29 Rockstar Learning Platform®
- 20 Rockstar Learning Platform Discussions
- 9 Rockstar Learning Platform Feature Requests
- 4 Off-the-Shelf Course Library
- 3 Off-the-Shelf Course Library Discussions
- 1 Off-the-Shelf Course Library Feature Requests
- 114 CourseMill®
- 107 CourseMill Discussions
- 43 ReviewLink®
- 31 ReviewLink Discussions
- 12 ReviewLink Suggestions
- 2 The Training Arcade®
- 1 The Training Arcade Discussions
- 1 The Training Arcade Feature Requests
- 10 Additional Learning Products
- 2 Adobe®
- 4 Articulate®
- 2 Camtasia®
- Docebo®
- 1 iSpring®
- 1 Microsoft® PowerPoint®
- 910 All Things eLearning
- 5 Course Development Showcase
- 1 eLearning Brothers® Downloads
- 1 Compliance Training
- 10 eLearning Development
- eLearning Game Design
- 7 Instructional Design
- 546 Learning Management System (LMS) Integration
- 2 Mobile Learning
- 5 Visual Design
- 328 Web Accessibility
- 1.2K ♪ The Green Room
- 7 ♡ Community Feedback
- 7 Community Tips