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

Make the NglDateAdapter an injection token #561

Open
jasedwards opened this issue Nov 24, 2021 · 0 comments · May be fixed by #562
Open

Make the NglDateAdapter an injection token #561

jasedwards opened this issue Nov 24, 2021 · 0 comments · May be fixed by #562

Comments

@jasedwards
Copy link

My enterprise application has to support over 200 cultures. Because of this there is no reasonable way for me to use the date picker with the current formatting options (I cannot translate a culture set at runtime to something like big-endian). Currently I grab the users date format based on culture from the server (.net) and bring that down when loading the app. this allows me to easily parse/format a date. If this adapter was made an injection token and you just injected an interface I could create my own adapter. This would also be a way to solve handling any format a user would like when using your control. The required change would be

datepicker-input.ts

@Inject(NGL_DATE_ADAPTER) adapter: INglDateAdapter

datepickers.module.ts

providers: [{provide: NGL_DATE_ADAPTER, useClass NglDateAdapter}]
jasedwards added a commit to jasedwards/ng-lightning that referenced this issue Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant