Overview
A tiny date formatting library with built-in i18n support.
Installation
# npm
npm i --save @weser/dates
# yarn
yarn add @weser/dates
# pnpm
pnpm add @weser/dates
Motivation
There are several date formatting libraries out there. It all started with Moment, while nowadays smaller alternatives such as date-fns, DayJS and Luxon among others are raising in popularity.
While date-fns already comes in a really small format, it was still way to big for my most common use case: Format a date with a given pattern.
So I created this tiny library as an attempt to solve this specific problem with as little bytes as possible.
How It works
I was using Intl.DateTimeFormat previously and really liked it. So I had the idea to use that under the hood while providing a nice API that accepts a pattern in a widely used format.
The nice thing about Intl.DateTimeFormat is that it has built-in i18n support.