Skip to content
native-dates

Plugins

The core covers what nearly every app does with a date. Each plugin adds one more thing when you import it, so you ship only the ones you use. Select the ones you want and copy the setup.

Start from a preset
app.js
// select plugins below to add them here
import { today } from 'native-dates';

today();
Selected
0 of 6
Plugins add
0.0 kB min+br
Total with core
7.3 kB min+br
  • ranges

    Spans between two dates, datetimes or times, with to(), contains(), overlaps() and points().

    1.6 kB min+br
  • tokens

    Token patterns such as YYYY-MM-DD HH:mm in format(), as Day.js and Moment write them.

    0.8 kB min+br
  • relative

    formatRelative(): “in 3 days” or “3 hours ago”, in the reader’s language.

    0.3 kB min+br
  • zones

    Zones by city, 'Berlin', by abbreviation, 'PT', and by names of your own.

    0.7 kB min+br
  • loose

    Reads what Date reads, such as 'March 5, 2026', and gives null for what can’t be read.

    0.2 kB min+br
  • legacy-date

    The Date getters, getFullYear() and the rest, on a datetime, for code that still calls them.

    0.3 kB min+br

Need something else?

A plugin is a module you import: it adds methods to the four nouns and wraps the ones already there. Writing a plugin covers how.