0.2.0 • Published 2 years ago
@fattureincloud/madbit-js-dates v0.2.0
MADBIT JS DATES
Summary
MadBit JS Dates is a library used to manipulate and display dates. At the moment it uses date-fns under the hood.
Support english, italian and spanish languages.
How do I get set up?
# Npm
npm install madbit-js-dates
# Yarn
yarn add madbit-js-datesHow to use it
import format from 'madbit-js-dates/format'
format('2023-07-07', 'dd/MM/yyyy', 'it')Shortcuts
| Parsable shortcuts | Corresponding value |
|---|---|
| 'now' | current date and time |
| 'NOW' | current date and time |
| 'yesterday' | yesterday date at this time |
| 'YESTERDAY' | yesterday date at this time |
| 'tomorrow' | tomorrow date at this time |
| 'TOMORROW' | tomorrow date at this time |
| Format shortcuts | Corresponding format |
|---|---|
| 'SQL' | SQL date format (YYYY-MM-DD) |
| 'SQL+T' | SQL datetime format (YYYY-MM-DD HH:mm:ss) |
| 'IT' | Italian date format (DD/MM/YYYY) |
| 'IT+T' | Italian datetime format (DD/MM/YYYY HH:mm:ss) |
| 'IT_FULL' | Italian date with month name (Ex. 22 May 2000) |
| 'IT_FULL+T' | Italian date and time with month name (Ex. 22 May 2000 13:34:55) |