Skip to main content
Skip table of contents

Converter JS API

There is a separate JavaScript API accessible from within converters. It currently has only one function.

formatDate: Formats a given date string to a desired format. Uses moment.js, so all format strings must be compliant to their specification.

JS
/**
 * @param {String} dateString date string specified in commonly understood ISO format
 * @param {String} formatString format string as required by moment.js
 * @param {String} (optional) originFormatString if the format of dateString is not in common format, specify
 * the format of the string as required by moment.js
 * @return {String} date string in the desired format
 */
PocketQuery.formatDate(dateString, formatString, originFormatString)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.