How to use the dayjs/esm.extend function in dayjs

To help you get started, we’ve selected a few dayjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marktext / marktext / src / renderer / util / day.js View on Github external
import dayjs from 'dayjs/esm'
import relativeTime from 'dayjs/esm/plugin/relativeTime'

// `en` is a built in locale. no need to import it.
// import 'dayjs/esm/locale/en' // load on demand
// dayjs.locale('en') // use en locale globally

dayjs.extend(relativeTime)

export default dayjs

dayjs

2KB immutable date time library alternative to Moment.js with the same modern API

MIT
Latest version published 25 days ago

Package Health Score

88 / 100
Full package analysis