intl
intl module is a new neo-jquery module this the the lightest size 1.06KB using the new api Intl and lightago variant
browser
<!--main file-->
<script src="https://cdn.jsdelivr.net/npm/neo-jquery/browser/intl.js"></script>
module
/* CJS */
const { $timeago } = require('neo-jquery/core/intl')
/* ESM */
import { $timeago } from 'neo-jquery/core/intl'
/* async/await and top level await*/
const { $timeago } = await import('neo-jquery/core/intl')
dynamic import is compatible with neo-jquery CJS
using
the using is easy except $timeago is unique form
$currency
$currency('es', 'EUR').format(35000)
desc | type |
---|---|
params: locale | string |
params: currency | string |
return | Intl.NumberFormat |
$list
const vehicles = ['Motorcycle', 'Bus', 'Car']
$list('en', 'long', 'conjunction').format(vehicles)
desc | type |
---|---|
params: locale | string |
params: style | Intl.ListFormatStyle |
params: type | Intl.ListFormatType |
return | Intl.ListFormat |
$timeago
$timeago('en') // date null
$timeago('en', '2012, 03, 30') // with date value
desc | type |
---|---|
params: locale | string |
params: date? | null | any |
return | string | undefined |