Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tools
mattermost
mattermost-plugin-walltime
Commits
b4fdc4c4
Commit
b4fdc4c4
authored
Jan 28, 2022
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
webapp/src/test.js
View file @
b4fdc4c4
...
...
@@ -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
);
});
});
webapp/src/time.js
View file @
b4fdc4c4
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment