MCPcopy Create free account
hub / github.com/adobe/react-spectrum / startOfWeek

Function startOfWeek

packages/@internationalized/date/src/queries.ts:235–242  ·  view source on GitHub ↗
(
  date: DateValue,
  locale: string,
  firstDayOfWeek?: DayOfWeek
)

Source from the content-addressed store, hash-verified

233): CalendarDate;
234export function startOfWeek(date: DateValue, locale: string, firstDayOfWeek?: DayOfWeek): DateValue;
235export function startOfWeek(
236 date: DateValue,
237 locale: string,
238 firstDayOfWeek?: DayOfWeek
239): DateValue {
240 let dayOfWeek = getDayOfWeek(date, locale, firstDayOfWeek);
241 return date.subtract({days: dayOfWeek});
242}
243
244/** Returns the last date of the week for the given date and locale. */
245export function endOfWeek(

Callers 10

useCalendarGridFunction · 0.90
CalendarGridFunction · 0.90
focusSectionStartFunction · 0.90
getDatesInWeekFunction · 0.90
alignStartFunction · 0.90
getCurrentYearMethod · 0.90
Calendar.test.jsFile · 0.90
endOfWeekFunction · 0.85
queries.test.jsFile · 0.85

Calls 2

getDayOfWeekFunction · 0.85
subtractMethod · 0.45

Tested by

no test coverage detected