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

feat(material-luxon-adapter): add option to set default calendar #27453

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

adotnusiyan
Copy link
Contributor

Add defaultOutputCalendar option to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS

Add defaultOutputCalendar option to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Jul 13, 2023
@zarend zarend self-assigned this Jul 14, 2023
@@ -71,6 +81,9 @@ export class LuxonDateAdapter extends DateAdapter<LuxonDateTime> {
this._useUTC = !!options?.useUtc;
this._firstDayOfWeek = options?.firstDayOfWeek || 0;
this.setLocale(dateLocale || LuxonDateTime.local().locale);

this._defaultOutputCalendar = options?.defaultOutputCalendar || 'gregory';
LuxonSettings.defaultOutputCalendar = this._defaultOutputCalendar;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this will affect uses of Luxon outside of Angular Material which we generally try to avoid. Can we do this only when constructing a date instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the code. Thanks

Update options of luxon-date-adapter to add defaultOutputCalendar to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto assigned crisbeto and unassigned zarend Jul 18, 2023
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Jul 18, 2023
@crisbeto crisbeto merged commit 439d6fc into angular:main Jul 18, 2023
11 of 12 checks passed
AnthonyFr75 pushed a commit to AnthonyFr75/components that referenced this pull request Jul 31, 2023
…ular#27453)

* feat(material-luxon-adapter): add option to set default calendar

Add defaultOutputCalendar option to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS

* feat(material-luxon-adapter): update options to add default calendar

Update options of luxon-date-adapter to add defaultOutputCalendar to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS
stephenrca pushed a commit to stephenrca/components that referenced this pull request Aug 2, 2023
…ular#27453)

* feat(material-luxon-adapter): add option to set default calendar

Add defaultOutputCalendar option to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS

* feat(material-luxon-adapter): update options to add default calendar

Update options of luxon-date-adapter to add defaultOutputCalendar to be able to change default calndar through MAT_LUXON_DATE_ADAPTER_OPTIONS
@adotnusiyan adotnusiyan deleted the luxon-default-calendar branch August 9, 2023 09:34
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants