Mantine Dates
Installation
Package depends on:
Install with npm:
Install with yarn:
Localization
Mantine dates uses dayjs library for localization. Follow example to load required locales in your application:
MantineProvider allows you to set a datesLocale
property for all date components, or you can overwrite the locale on a per component basis:
Components
Mo | Tu | We | Th | Fr | Sa | Su |
---|---|---|---|---|---|---|
Mo | Tu | We | Th | Fr | Sa | Su |
---|---|---|---|---|---|---|
Mo | Tu | We | Th | Fr | Sa | Su |
---|---|---|---|---|---|---|
Utility functions
Apart from components @mantine/dates package also exports several utility functions.
get-month-days
Returns an array of weeks of current month:
get-months-names
Returns months names for given locale and format:
get-weekdays-names
Returns an array of short weekdays names for given locale:
get-years-range
Returns an array of years, which fall into given range:
is-same-date
Returns true if two dates have the same year, month and date, other properties (minutes, seconds, etc.) are ignored:
is-same-month
Returns true if two dates have the same year and month, other properties (date, minutes, seconds, etc.) are ignored: