MCPcopy Index your code
hub / github.com/angular/angular / timezoneToOffset

Function timezoneToOffset

packages/common/src/i18n/format_date.ts:889–895  ·  view source on GitHub ↗
(timezone: string, fallback: number)

Source from the content-addressed store, hash-verified

887}
888
889function timezoneToOffset(timezone: string, fallback: number): number {
890 // Support: IE 11 only, Edge 13-15+
891 // IE/Edge do not "understand" colon (`:`) in timezone
892 timezone = timezone.replace(/:/g, '');
893 const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
894 return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
895}
896
897function addDateMinutes(date: Date, minutes: number) {
898 date = new Date(date.getTime());

Callers 2

formatDateFunction · 0.85
convertTimezoneToLocalFunction · 0.85

Calls 2

parseMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…