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

Function parseDateAndConvertTimeZoneToLocal

test/angular/1.7/angular.js:26761–26776  ·  view source on GitHub ↗
(value, previousDate)

Source from the content-addressed store, hash-verified

26759 }
26760
26761 function parseDateAndConvertTimeZoneToLocal(value, previousDate) {
26762 var timezone = ctrl.$options.getOption('timezone');
26763
26764 if (previousTimezone && previousTimezone !== timezone) {
26765 // If the timezone has changed, adjust the previousDate to the default timezone
26766 // so that the new date is converted with the correct timezone offset
26767 previousDate = addDateMinutes(previousDate, timezoneToOffset(previousTimezone));
26768 }
26769
26770 var parsedDate = parseDate(value, previousDate);
26771
26772 if (!isNaN(parsedDate) && timezone) {
26773 parsedDate = convertTimezoneToLocal(parsedDate, timezone);
26774 }
26775 return parsedDate;
26776 }
26777
26778 function formatter(value, timezone) {
26779 var targetFormat = format;

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