Show current time merge field
Hi - we have a dynamic SKUID dashboard with a snippet refreshing the page every 5 minutes. We would like to show the current time at each refresh - something like 'Last Updated : xxxxxxx'.
I tried by adding a template at top of the page, with the following in the HTML:
Last Updated : {{$System.Now}}
but that didn't work. I have checked through the listed merge variables:
http://help.skuidify.com/m/11720/l/187263-global-merge-variables-functions
but don't see System listed. Any ideas as to how to pull in the date & time ?
I tried by adding a template at top of the page, with the following in the HTML:
Last Updated : {{$System.Now}}
but that didn't work. I have checked through the listed merge variables:
http://help.skuidify.com/m/11720/l/187263-global-merge-variables-functions
but don't see System listed. Any ideas as to how to pull in the date & time ?
Tagged:
2
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
as I already had snippet running to do the refresh, I added code to get the date/time and insert into the appropriate element on the page:
I've had similar issues of needing to present values up to a template (or elsewhere) via mustache. The little trick I use is to fake it as a URL parameter, such as: This puts the value into in the $Param variable, which can then be accessed in a template (or elsewhere that mustache is supported) via something like: I'd love it we had a more official way to pass values up to mustache, but I've not found it yet.
Also - for formatting the date / time - here is a short hand I have used... which outputs something like So the final (hack) string to do it all is... - Chris
I'm trying to use .formatTime ("h:mm a", new Date()) but it just crashes no matter what I try
e.g.
skuid.page.params.CurrentTime = new Date().formatTime ("h:mm a", skuid.time.getSFDateTime) or
skuid.page.params.CurrentTime = skuid.time.getSFDateTime().formatTime ("h:mm a", new Date())
i just don't know how to add the formatTime function...