-
Notifications
You must be signed in to change notification settings - Fork 161
feat(calendar): make weekStart default value to depend on current locale #11458
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
Conversation
…com/IgniteUI/igniteui-angular into VDyulgerov/feature-startWeek-locale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugs found:
- Let's set a global
LOCALE_ID
for calendar.sample.html:
@Component({
selector: 'app-calendar-sample',
templateUrl: 'calendar.sample.html',
styleUrls: ['calendar.sample.scss'],
providers: [{provide: LOCALE_ID, useValue: 'fr-FR' }]
})
Result:
Calendar is not displayed per FR locale. This is Story 1 from the spec.
- When passing invalid value for locale, then setting
weekStart
is not respected:
<igx-date-picker **locale='US'** [weekStart]="5"
Result: weekStart
is not Friday. Check if same is for grid, date-range picker, etc.
@@ -258,6 +259,9 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor { | |||
*/ | |||
public set locale(value: string) { | |||
this._locale = value; | |||
if (!this.weekStart) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have set weekStart
to be WEEKDAYS.Sunday (equals 0), this check will always evaluate as true
and override the value. Example:
<igx-date-picker locale="FR" [weekStart]="0"
weekStart
will always be 1, which is the default of french locale.
…com/IgniteUI/igniteui-angular into VDyulgerov/feature-startWeek-locale
…com/IgniteUI/igniteui-angular into VDyulgerov/feature-startWeek-locale
This reverts commit ced5f9e.
…com/IgniteUI/igniteui-angular into VDyulgerov/feature-startWeek-locale
Closes #10543, #10852
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)