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

Merge branch 'issue-53/ambiguous-time-tokens' into deploys/test-20220127

parents cf282ae2 c0e7af18
Pipeline #36232 passed with stages
in 17 minutes and 29 seconds
......@@ -108,3 +108,13 @@ test('ignoreHyperlinks', () => {
const input = 'https://example.com/directory/test-2022-0900 is not a timestamp';
expect(convertTimesToLocal(input, 1563387832493, 'Asia/Tokyo', 'en')).toEqual(input);
});
test('avoidTimezoneTokenAmbiguity', () => {
const testCases = [
'People visiting Buñol towards the end of August get a good chance to participate in La Tomatina (under normal circumstances)',
];
testCases.forEach((input) => {
expect(convertTimesToLocal(input, 1642761512000, 'America/Vancouver', 'en')).toEqual(input);
});
});
......@@ -35,6 +35,10 @@ export function convertTimesToLocal(message, messageCreationTime, localTimezone,
return message;
}
if (parsedTime.start.isCertain('month') && !parsedTime.start.isCertain('day')) {
return message;
}
let renderingFormat = DATE_AND_TIME_FORMAT;
let formattedDisplayDate;
......
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