Zengine provides filters for you to use in your plugin html, as well as inject as dependencies in your plugin js.
znUserDate filter takes as input a date string and converts it into the user-preferred format. It works best if the input string is in ISO 8601 or ‘YYYY-MM-DD’ format; other formats can lead to inconsistent results across browsers. This filter should be used anytime you present dates in your plugin.
You can use it in your html, like any other filter.
znNumericValue filter takes as input a numeric value and a field object and formats it according to the field settings. The object doesn’t need to be the full field; it just needs to contain the following properties:
In the example above, the filter would round the number to 2 decimals, and prepend it with a USD symbol. The final output would look like this: