The case of the missing zero
Apr 30, 2013
I asked this earlier so thought I'd try again. I am pulling in the current time into one of my Storyline modules.
The time displays correctly when viewing the Flash output but in html5 the leading zero does not display when the minutes are under 10. So 7:01 displays as 7:1
This problem was also occurring in the Flash output but I added some code that fixed it in Flash but not in html5.
Here is a link to the storyline file. I was hoping that somebody could take a look at my code and tell me what I am doing wrong.
https://dl.dropboxusercontent.com/u/73851/demo1slide.zip
Thanks so much
Nancy
6 Replies
Are you using javascript? Have you tried changing the value into a string instead of a number? or do you need to keep it as a number for calculation purposes? Maybe you can have one version as a string and another as a number?
Hi Jerson, I'm using JavaScript. I am not doing any calculation - just displaying the current date and time.
I only understand the basics of Javascript. Have you tried looking at javascript forums? Maybe somebody else has ran into the same problem but in a different application.
Hi Nancy,
Do you have to use "meridiem" ?
My JS code involves just 2 variables so it's a little different, but it all works in one JS call.
Just make sure to include two additional text variables, SystemDate and SystemTime in your story (JS code attached.
Hope this helps,
Alex
@ Jerson - I am probably in the same boat as you when it comes to JavaScript. I just know enough to be dangerous. I have checked around in the various forums but so far with no luck.
@ Alexandros - I don't have to use the meridem but it like it because it displays the time in am and pm. It is nicer than using the 24 hour clock. I'm not sure if this is what is causing the problem. It seems to display correctly. The only issue I am having is the leading zero on the minutes.
@Alexandros - your code solved the problem so thank you.
@Jerson - I think you were right about using a string instead of a number.
This discussion is closed. You can start a new discussion or contact Articulate Support.