Localization provider
Lab componentLocalization provider
The LocalizationProvider
component is essential for configuring the locale and date adapter in components that utilize date objects.
To integrate your date framework with Salt components and enable support for locales or timezones, defining a date adapter is essential. Salt provides date adapters for the most popular date frameworks, which you can extend or use as a foundation to create your own custom adapter.
- Day.js: Recommended for its small footprint, this library returns immutable Day.js objects.
- date-fns: Ideal for comprehensive date manipulation, it returns native JavaScript
Date
objects. - Luxon: A modern successor to Moment.js, it returns Luxon objects.
- Moment.js: A legacy library that is no longer actively maintained.
Use LocalizationProvider
to change the min/max dates for the date adapter. These represent the fallback dates when no
min/max date is provided by the component.
In this example, date selection is limited to 3 months.
To integrate your date framework with Salt components and enable support for locales or timezones, defining a date adapter is essential. Salt provides date adapters for the most popular date frameworks, which you can extend or use as a foundation to create your own custom adapter.
- Day.js: Recommended for its small footprint, this library returns immutable Day.js objects.
- date-fns: Ideal for comprehensive date manipulation, it returns native JavaScript
Date
objects. - Luxon: A modern successor to Moment.js, it returns Luxon objects.
- Moment.js: A legacy library that is no longer actively maintained.
Use LocalizationProvider
to change the min/max dates for the date adapter. These represent the fallback dates when no
min/max date is provided by the component.
In this example, date selection is limited to 3 months.
To integrate your date framework with Salt components and enable support for locales or timezones, defining a date adapter is essential. Salt provides date adapters for the most popular date frameworks, which you can extend or use as a foundation to create your own custom adapter.
- Day.js: Recommended for its small footprint, this library returns immutable Day.js objects.
- date-fns: Ideal for comprehensive date manipulation, it returns native JavaScript
Date
objects. - Luxon: A modern successor to Moment.js, it returns Luxon objects.
- Moment.js: A legacy library that is no longer actively maintained.
Use LocalizationProvider
to change the min/max dates for the date adapter. These represent the fallback dates when no
min/max date is provided by the component.
In this example, date selection is limited to 3 months.