Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support only having some params set in localization #109

Open
umer936 opened this issue Jun 16, 2022 · 2 comments
Open

Support only having some params set in localization #109

umer936 opened this issue Jun 16, 2022 · 2 comments

Comments

@umer936
Copy link

umer936 commented Jun 16, 2022

Say I just want to change the placeholder.

Currently, I have to pass in all of the fields in localization according to #29 (comment) . However, I have found that as long as I pass in dayNames, monthNames, and monthNamesShort, 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.

@rdebeasi
Copy link

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';

@rdebeasi
Copy link

rdebeasi commented Aug 1, 2022

See also #101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants