MCPcopy
hub / github.com/angular-ui/ui-grid / parseDateAndConvertTimeZoneToLocal

Function parseDateAndConvertTimeZoneToLocal

lib/test/angular/1.7.0/angular.js:25972–25987  ·  view source on GitHub ↗
(value, previousDate)

Source from the content-addressed store, hash-verified

25970 }
25971
25972 function parseDateAndConvertTimeZoneToLocal(value, previousDate) {
25973 var timezone = ctrl.$options.getOption('timezone');
25974
25975 if (previousTimezone && previousTimezone !== timezone) {
25976 // If the timezone has changed, adjust the previousDate to the default timezone
25977 // so that the new date is converted with the correct timezone offset
25978 previousDate = addDateMinutes(previousDate, timezoneToOffset(previousTimezone));
25979 }
25980
25981 var parsedDate = parseDate(value, previousDate);
25982
25983 if (!isNaN(parsedDate) && timezone) {
25984 parsedDate = convertTimezoneToLocal(parsedDate, timezone);
25985 }
25986 return parsedDate;
25987 }
25988 };
25989}
25990

Callers 2

createDateInputTypeFunction · 0.70
parseObservedDateValueFunction · 0.70

Calls 3

addDateMinutesFunction · 0.70
timezoneToOffsetFunction · 0.70
convertTimezoneToLocalFunction · 0.70

Tested by

no test coverage detected