32 lines
521 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Moment.js
This guide shows you how to install and use Moment.js, a popular date library in ToonBoom Harmony.
Install it from NPM and create a new script file:
```sh
npm install moment
touch ./src/scripts/moment.ts
```
Use ES modules to import the library:
```ts
// src/scripts/moment.ts
import moment from "moment";
MessageLog.trace(moment().locale("es").format("LLLL"));
```
Build it:
```sh
npm run build
```
Then run `dist/moment.js` in Harmony:
```txt
martes, 18 de noviembre de 2025 12:23
```