Skip to content

Commit

Permalink
Merge branch 'master' into e2e-protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
taoeffect committed Jan 17, 2024
2 parents 76cc6fc + 8b708e0 commit 25b53e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/model/contracts/shared/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ export function timeSince (datems: number, dateNow: number = Date.now()): string

if (interval >= DAYS_MILLIS * 2) {
// Make sure to replace any ordinary space character by a non-breaking one.
return humanDate(datems).replace(/\x32/g, '\xa0')
// $FlowFixMe
return humanDate(datems).replaceAll(' ', '\xa0')
}
if (interval >= DAYS_MILLIS) {
return L('1d')
Expand Down
4 changes: 2 additions & 2 deletions frontend/model/contracts/shared/time.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ describe('timeSince', function () {
)).equal('1d')
})

it('should return current day when +48h have passed', () => {
it('should return current day (with non-breaking space) when +48h have passed', () => {
should(timeSince(
currentDate - DAYS_MILLIS * 23,
currentDate
)).equal('May 7')
)).equal('May\xa07')
})
})

0 comments on commit 25b53e7

Please sign in to comment.