We’re trying to format a date for different languages; there’s a class named “TextFormatter” which seems to bring a whole bunch of formatting functions - but which ones are available and how can they be called (parameters etc.)?
Hello Thomas,
Unfortunately the documentation is currently lacking the API reference, we’re working on getting this integrated as soon as we can.
In the meantime, a great tip to know how a function is used is to add a Text script by dragging a field from the Record pane onto the page, making sure this field is of the type you want to format (TextFormatter is dependant on the field type such as date, string, currency, etc). Then, use the “Format” drop-down to select which format you’d like (for example for dates you can select Medium Date, Short Date, etc). Once that’s done, hit the “Expand” button at the bottom of the script wizard and that’ll convert it into an editable script. You can study that as you please.
For example, for a date you have:
var format = new TextFormatter(locale);
var shortDate = format.dateShort(record.fields.date);
var mediumDate = format.dateMedium(record.fields.date_)__;_
etc. (locale is a global var representing the locale set in Edit -> Locale).
We will provide more details as time goes by, in the documentation.