Commit e92f9946 authored by James Addison's avatar James Addison
Browse files

Avoid access to private object properties

parent 4289cded
Pipeline #31762 passed with stages
in 20 minutes and 39 seconds
......@@ -37,8 +37,7 @@ export function convertTimesToLocal(message, messageCreationTime, localTimezone,
delete parsedTime.start.knownValues.timezoneOffset;
}
const anchorTimezoneStart = parsedTime.start.knownValues.timezoneOffset;
if (typeof anchorTimezoneStart === 'undefined') {
if (!parsedTime.start.isCertain('timezoneOffset')) {
return message;
}
......@@ -48,7 +47,7 @@ export function convertTimesToLocal(message, messageCreationTime, localTimezone,
const currentUserStartDate = moment(parsedTime.start.date()).tz(localTimezone).locale(locale);
if (!currentUserStartDate.isSame(moment(), 'year')) {
renderingFormat = DATE_FORMAT;
} else if (typeof parsedTime.start.knownValues.day === 'undefined' && typeof parsedTime.start.knownValues.weekday === 'undefined') {
} else if (!parsedTime.start.isCertain('day') && !parsedTime.start.isCertain('weekday')) {
renderingFormat = TIME_FORMAT;
}
if (parsedTime.end) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment