Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants