Reputation: 2169
I created a javascript function : Time.js
:
var now = new moment();
console.log(now.format("HH:mm:ss"));
And now I would want to add it on my custom control to see if it works. How to appeal this function/library? Should it be as a default value for a computed field?
Thanks for your attention!
Upvotes: 0
Views: 525
Reputation: 2565
If you simply want to display the current time in a text field, you can use the @Now "at function" as below, with a converter:
<xp:text escape="true" id="computedField1" value="#{javascript:@Now()}">
<xp:this.converter>
<xp:convertDateTime type="time"></xp:convertDateTime>
</xp:this.converter>
</xp:text>
When you say "continuous time & date" though, do you mean you want it to continuously update?
Upvotes: 1