0
votes

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!

  • What I need exactly is a function for a continuos time & date. In Lotus Notes Client i made it by creating a function helped by the JSHeader but in Xpages I don't know how, many thanks.
1
If you've found a solution that works, please create it as answer to your own question, so others can use your code as well. - David Navarre

1 Answers

1
votes

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?