MCPcopy Index your code
hub / github.com/angular-ui/ui-router / parseDateAndConvertTimeZoneToLocal

Function parseDateAndConvertTimeZoneToLocal

test/angular/1.6/angular.js:25821–25836  ·  view source on GitHub ↗
(value, previousDate)

Source from the content-addressed store, hash-verified

25819 }
25820
25821 function parseDateAndConvertTimeZoneToLocal(value, previousDate) {
25822 var timezone = ctrl.$options.getOption('timezone');
25823
25824 if (previousTimezone && previousTimezone !== timezone) {
25825 // If the timezone has changed, adjust the previousDate to the default timezone
25826 // so that the new date is converted with the correct timezone offset
25827 previousDate = addDateMinutes(previousDate, timezoneToOffset(previousTimezone));
25828 }
25829
25830 var parsedDate = parseDate(value, previousDate);
25831
25832 if (!isNaN(parsedDate) && timezone) {
25833 parsedDate = convertTimezoneToLocal(parsedDate, timezone);
25834 }
25835 return parsedDate;
25836 }
25837 };
25838}
25839

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