Skip to main content

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)
desctype
params: localestring
params: currencystring
returnIntl.NumberFormat

$list

const vehicles = ['Motorcycle', 'Bus', 'Car']

$list('en', 'long', 'conjunction').format(vehicles)
desctype
params: localestring
params: styleIntl.ListFormatStyle
params: typeIntl.ListFormatType
returnIntl.ListFormat

$timeago

$timeago('en') // date null
$timeago('en', '2012, 03, 30') // with date value
desctype
params: localestring
params: date?null | any
returnstring | undefined