You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
319
+
320
+
```tsx
321
+
startOfWeek(date, 'en-US', 'mon'); // 2022-01-31
322
+
```
323
+
318
324
### Day of week
319
325
320
326
The <TypeLinklinks={docs.links}type={docs.exports.getDayOfWeek} /> function returns the day of the week for the given date and locale. Days are numbered from zero to six, where zero is the first day of the week in the given locale. For example, in the United States, the first day of the week is Sunday, but in France it is Monday.
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
338
+
339
+
```tsx
340
+
getDayOfWeek(date, 'en-US', 'mon'); // 6
341
+
```
342
+
331
343
### Weekdays and weekends
332
344
333
345
The <TypeLinklinks={docs.links}type={docs.exports.isWeekday} /> and <TypeLinklinks={docs.links}type={docs.exports.isWeekend} /> functions can be used to determine if a date is weekday or weekend respectively. This depends on the locale. For example, in the United States, weekends are Saturday and Sunday, but in Israel they are Friday and Saturday.
@@ -356,3 +368,9 @@ let date = new CalendarDate(2021, 1, 1);
356
368
getWeeksInMonth(date, 'en-US'); // 6
357
369
getWeeksInMonth(date, 'fr-FR'); // 5
358
370
```
371
+
372
+
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
The <TypeLinklinks={docs.links}type={docs.exports.getDayOfWeek} /> function returns the day of the week for the given date and locale. Days are numbered from zero to six, where zero is the first day of the week in the given locale. For example, in the United States, the first day of the week is Sunday, but in France it is Monday.
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
390
+
391
+
```tsx
392
+
getDayOfWeek(date, 'en-US', 'mon'); // 6
393
+
```
394
+
383
395
### Weekdays and weekends
384
396
385
397
The <TypeLinklinks={docs.links}type={docs.exports.isWeekday} /> and <TypeLinklinks={docs.links}type={docs.exports.isWeekend} /> functions can be used to determine if a date is weekday or weekend respectively. This depends on the locale. For example, in the United States, weekends are Saturday and Sunday, but in Israel they are Friday and Saturday.
@@ -408,3 +420,9 @@ let date = new CalendarDateTime(2021, 1, 1, 8, 30);
408
420
getWeeksInMonth(date, 'en-US'); // 6
409
421
getWeeksInMonth(date, 'fr-FR'); // 5
410
422
```
423
+
424
+
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
The <TypeLinklinks={docs.links}type={docs.exports.getDayOfWeek} /> function returns the day of the week for the given date and locale. Days are numbered from zero to six, where zero is the first day of the week in the given locale. For example, in the United States, the first day of the week is Sunday, but in France it is Monday.
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
498
+
499
+
```tsx
500
+
getDayOfWeek(date, 'en-US', 'mon'); // 6
501
+
```
502
+
491
503
### Weekdays and weekends
492
504
493
505
The <TypeLinklinks={docs.links}type={docs.exports.isWeekday} /> and <TypeLinklinks={docs.links}type={docs.exports.isWeekend} /> functions can be used to determine if a date is weekday or weekend respectively. This depends on the locale. For example, in the United States, weekends are Saturday and Sunday, but in Israel they are Friday and Saturday.
@@ -516,3 +528,9 @@ let date = parseZonedDateTime('2023-01-01T08:30[America/Los_Angeles]');
516
528
getWeeksInMonth(date, 'en-US'); // 5
517
529
getWeeksInMonth(date, 'fr-FR'); // 6
518
530
```
531
+
532
+
You can also provide an optional `firstDayOfWeek` argument to override the default first day of the week determined by the locale. It accepts a week day abbreviation, e.g. `sun`, `mon`, `tue`, etc.
By default, the first day of the week is automatically set based on the current locale. This can be changed by setting the `firstDayOfWeek` prop to `'sun'`, `'mon'`, `'tue'`, `'wed'`, `'thu'`, `'fri'`, or `'sat'`.
An aria-label must be provided to the `Calendar` for accessibility. If it is labeled by a separate element, an `aria-labelledby` prop must be provided using the `id` of the labeling element instead.
By default, the first day of the week is automatically set based on the current locale. This can be changed by setting the `firstDayOfWeek` prop to `'sun'`, `'mon'`, `'tue'`, `'wed'`, `'thu'`, `'fri'`, or `'sat'`.
An aria-label must be provided to the `RangeCalendar` for accessibility. If it is labeled by a separate element, an `aria-labelledby` prop must be provided using the `id` of the labeling element instead.
0 commit comments