Open umer936 opened 2 years ago
That feature would be super helpful! As a workaround, the default localization options can be imported from here:
import dateLocalization from '@duetds/date-picker/dist/collection/components/duet-date-picker/date-localization';
The defaults can be used like this:
myDatePickerElement.localization = {
...dateLocalization,
locale: 'en-US'
};
This module doesn't include type declarations, so you'll need to declare the module in a d.ts
file if you're using TypeScript:
declare module '@duetds/date-picker/dist/collection/components/duet-date-picker/date-localization';
See also #101
Say I just want to change the placeholder.
Currently, I have to pass in all of the fields in localization according to https://github.com/duetds/date-picker/issues/29#issuecomment-700696092 . However, I have found that as long as I pass in
dayNames
,monthNames
, andmonthNamesShort
, nothing breaks.Describe the solution you'd like If I just want to change the placeholder, there's no reason I need to have my own copies of the fields in the localization object. It should default to the default if a value is not given.