Getting StartedStateThemingCompositionDate FrameworksLocalizationFormat NamesDate-fns with a Russian localeDayjs with a Chinese localeLuxon with a French localeMoment with a Spanish localeAnimatedGroupAnimatedMonthGroupCalendarCalendarProviderClickOutsideDayDayOfWeekHeaderHomeMonthMonthGroupPopperRootWeekWeekHeaderuseCalendarDispatchuseCalendarPropsuseCalendarStateuseDateAPIuseDateInputuseDateRangeInput
Components
Hooks
Localization
Localization is provided by adding a format
callback to your date adapter.
The format
function uses the date frameworks' localization to format dates.
The signature of format
is
format(date, formatName)
date
is the date object to formatformatName
is an enum for the required format
Format Names
For convenience the format names can be imported from @use-date-input/core
import { formatNames } from `@use-date-input/core`
The full list of formatName
values
Format Name | Description | Example |
---|---|---|
ARIA_DAY_LABEL | Returns aria label for day component | 6th August 2020 |
ARIA_START_LABEL | Returns aria label for start of range | Selected 15th September 2020 as start date |
ARIA_END_LABEL | Returns aria label for end of range | Selected 15th September 2020 as end date |
ISO | Returns date in ISO format | 2020-01-17 |
HEADER | Returns header label | 2020 |
DAY | Returns day label | 17 |
DAY_OF_WEEK_FULL | Returns day of week full label | Monday |
DAY_OF_WEEK_ABBREVIATED | Returns day of week short label | Mo |
MONTH | Returns month index | 1 |
MONTH_ABBREVIATED | Returns month short label | Jan |
MONTH_FULL | Returns month full label | January |
YEAR | Returns year | 2020 |
To change the text returned for a locale or to customize the labels, modify the default `format function provided by your adapter.
Date-fns with a Russian locale
As shown here, where we use date-dns
to create a Russian calendar.
2025
марта
вс
пн
вт
ср
чт
пт
сб
2324252627281
2345678
9101112131415
16171819202122
23242526272829
303112345
апреля
вс
пн
вт
ср
чт
пт
сб
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
мая
вс
пн
вт
ср
чт
пт
сб
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
июня
вс
пн
вт
ср
чт
пт
сб
1234567
891011121314
15161718192021
22232425262728
293012345
6789101112
июля
вс
пн
вт
ср
чт
пт
сб
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
августа
вс
пн
вт
ср
чт
пт
сб
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
сентября
вс
пн
вт
ср
чт
пт
сб
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
октября
вс
пн
вт
ср
чт
пт
сб
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
ноября
вс
пн
вт
ср
чт
пт
сб
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
декабря
вс
пн
вт
ср
чт
пт
сб
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
января
вс
пн
вт
ср
чт
пт
сб
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
февраля
вс
пн
вт
ср
чт
пт
сб
1234567
891011121314
15161718192021
22232425262728
1234567
Dayjs with a Chinese locale
2025
三月
一
二
三
四
五
六
日
242526272812
3456789
10111213141516
17181920212223
24252627282930
31123456
四月
一
二
三
四
五
六
日
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
五月
一
二
三
四
五
六
日
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
六月
一
二
三
四
五
六
日
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
七月
一
二
三
四
五
六
日
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
八月
一
二
三
四
五
六
日
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
九月
一
二
三
四
五
六
日
1234567
891011121314
15161718192021
22232425262728
293012345
6789101112
十月
一
二
三
四
五
六
日
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
十一月
一
二
三
四
五
六
日
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567
十二月
一
二
三
四
五
六
日
1234567
891011121314
15161718192021
22232425262728
2930311234
567891011
一月
一
二
三
四
五
六
日
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
二月
一
二
三
四
五
六
日
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678
Luxon with a French locale
2025
mars
L
M
M
J
V
S
D
242526272812
3456789
10111213141516
17181920212223
24252627282930
31123456
avril
L
M
M
J
V
S
D
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
mai
L
M
M
J
V
S
D
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
juin
L
M
M
J
V
S
D
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
juillet
L
M
M
J
V
S
D
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
août
L
M
M
J
V
S
D
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
septembre
L
M
M
J
V
S
D
1234567
891011121314
15161718192021
22232425262728
293012345
6789101112
octobre
L
M
M
J
V
S
D
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
novembre
L
M
M
J
V
S
D
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567
décembre
L
M
M
J
V
S
D
1234567
891011121314
15161718192021
22232425262728
2930311234
567891011
janvier
L
M
M
J
V
S
D
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
février
L
M
M
J
V
S
D
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678
Moment with a Spanish locale
2025
marzo
lu
ma
mi
ju
vi
sá
do
242526272812
3456789
10111213141516
17181920212223
24252627282930
31123456
abril
lu
ma
mi
ju
vi
sá
do
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
mayo
lu
ma
mi
ju
vi
sá
do
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
junio
lu
ma
mi
ju
vi
sá
do
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
julio
lu
ma
mi
ju
vi
sá
do
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
agosto
lu
ma
mi
ju
vi
sá
do
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
septiembre
lu
ma
mi
ju
vi
sá
do
1234567
891011121314
15161718192021
22232425262728
293012345
6789101112
octubre
lu
ma
mi
ju
vi
sá
do
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
noviembre
lu
ma
mi
ju
vi
sá
do
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567
diciembre
lu
ma
mi
ju
vi
sá
do
1234567
891011121314
15161718192021
22232425262728
2930311234
567891011
enero
lu
ma
mi
ju
vi
sá
do
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
febrero
lu
ma
mi
ju
vi
sá
do
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678