Skip to content

Additional Scripting Libraries

In addition to the core BizzStream scripting functions and standard JavaScript features, the scripting environment includes several third-party libraries that provide helpful utilities for common programming tasks.

Lodash Library

Lodash is a JavaScript library that provides a wide range of utility functions for common programming tasks, especially working with collections (arrays and objects). It offers handy methods for iterating, mapping, reducing, filtering, and sorting data.

You can access Lodash methods through the global _ object within your scripts.

Extensive documentation for Lodash methods can be found here: Lodash.

Day.js Library

Day.js is a minimalist JavaScript library for parsing, validating, manipulating, and formatting dates and times. It is designed to be a lightweight alternative with a simple API similar to Moment.js.

You can access Day.js methods through the global dayjs object within your scripts.

Extensive documentation for Day.js methods and available plugins can be found here: Day.js.

Day.js Example: Parsing and Formatting a Date

This example shows how to parse a date string and format it using Day.js.

var date = '2017-09-10';
var jsDate = dayjs(date); // Use dayjs object
console.log(jsDate.format());

// Expected console.log output (format varies by locale/configuration, but typically ISO 8601):
// 2017-09-10T00:00:00+00:00

Day.js Setting the Locale

Day.js supports locales to handle date parsing and formatting based on regional conventions.

To set the locale, you typically need to load the locale data and then use the dayjs.locale() method:

// Assuming 'nl' locale data is loaded or available
dayjs.locale('nl'); // Set locale to Dutch

// After setting the locale, subsequent Day.js operations may use Dutch conventions.