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

Function getHoursInDay

packages/@internationalized/date/src/queries.ts:129–134  ·  view source on GitHub ↗
(a: CalendarDate, timeZone: string)

Source from the content-addressed store, hash-verified

127 * Usually this is 24, but it could be 23 or 25 if the date is on a daylight saving transition.
128 */
129export function getHoursInDay(a: CalendarDate, timeZone: string): number {
130 let ms = toAbsolute(a, timeZone);
131 let tomorrow = a.add({days: 1});
132 let tomorrowMs = toAbsolute(tomorrow, timeZone);
133 return (tomorrowMs - ms) / 3600000;
134}
135
136let localTimeZone: string | null = null;
137let localTimeZoneOverride = false;

Callers

nothing calls this directly

Calls 2

toAbsoluteFunction · 0.90
addMethod · 0.65

Tested by

no test coverage detected