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 format
  • formatName 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 NameDescriptionExample
ARIA_DAY_LABELReturns aria label for day component6th August 2020
ARIA_START_LABELReturns aria label for start of rangeSelected 15th September 2020 as start date
ARIA_END_LABELReturns aria label for end of rangeSelected 15th September 2020 as end date
ISOReturns date in ISO format2020-01-17
HEADERReturns header label2020
DAYReturns day label17
DAY_OF_WEEK_FULLReturns day of week full labelMonday
DAY_OF_WEEK_ABBREVIATEDReturns day of week short labelMo
MONTHReturns month index1
MONTH_ABBREVIATEDReturns month short labelJan
MONTH_FULLReturns month full labelJanuary
YEARReturns year2020

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
do
242526272812
3456789
10111213141516
17181920212223
24252627282930
31123456
abril
lu
ma
mi
ju
vi
do
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
mayo
lu
ma
mi
ju
vi
do
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
junio
lu
ma
mi
ju
vi
do
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
julio
lu
ma
mi
ju
vi
do
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
agosto
lu
ma
mi
ju
vi
do
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
septiembre
lu
ma
mi
ju
vi
do
1234567
891011121314
15161718192021
22232425262728
293012345
6789101112
octubre
lu
ma
mi
ju
vi
do
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
noviembre
lu
ma
mi
ju
vi
do
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567
diciembre
lu
ma
mi
ju
vi
do
1234567
891011121314
15161718192021
22232425262728
2930311234
567891011
enero
lu
ma
mi
ju
vi
do
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
febrero
lu
ma
mi
ju
vi
do
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678