All locations

The following actions are available in all locations in the Sell product:

formatDateAndTime

Formats a given date-time respecting the user's formatting and timezone settings.

The action takes two arguments: - a JavaScript Date instance - a timezone source (optional)

You can set the timezone source to 'account' or 'local' to format the date-time using the account settings or the local timezone. The default is 'local'.

invoke
client.invoke('formatDateAndTime', new Date(), 'account');
returns
{
  "formatDateAndTime": "10/01/2019 04:22 PM"
}
formatDate

Formats a given date respecting the user's formatting and timezone settings.

The action takes two arguments: - a JavaScript Date instance - a timezone source (optional)

You can set the timezone source to 'account' or 'local' to format the date-time using the account settings or the local timezone. The default is 'local'.

invoke
client.invoke('formatDate', new Date(), 'account');
returns
{
  "formatDate": "10/01/2019"
}
formatCurrency

Formats a given amount respecting the user's formatting settings.

The action takes two arguments: - an amount to format (string or a number) - a currency code (optional)

To specify a currency, use ISO 4217 currency codes such as 'USD' for US dollars or 'EUR' for Euros. See the Current currency & funds code list.

If you don't specify one, the currency defaults to the account's currency.

invoke
client.invoke('formatCurrency', '100.01');
returns
{
  "formatCurrency": "$100.01"
}