JavaScript
Import JavaScript and use custom elements
This page imports a JavaScript file from a Haml component. The script defines a customized built-in element that formats times in the browser.
IntlTime custom element
| date_style | time_style | Output |
|---|---|---|
| "full" | "full" | |
| "full" | "long" | |
| "full" | "medium" | |
| "full" | "short" | |
| "full" | nil | |
| "long" | "full" | |
| "long" | "long" | |
| "long" | "medium" | |
| "long" | "short" | |
| "long" | nil | |
| "medium" | "full" | |
| "medium" | "long" | |
| "medium" | "medium" | |
| "medium" | "short" | |
| "medium" | nil | |
| "short" | "full" | |
| "short" | "long" | |
| "short" | "medium" | |
| "short" | "short" | |
| "short" | nil | |
| nil | "full" | |
| nil | "long" | |
| nil | "medium" | |
| nil | "short" | |
| nil | nil |