refactor: localized date time

This commit is contained in:
Mary
2024-05-30 11:19:47 +07:00
committed by Eric Bailey
parent 6f0764de1d
commit bf924a9a43
10 changed files with 84 additions and 44 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
import {RichText} from '@atproto/api'
import {I18n} from '@lingui/core'
import {parseEmbedPlayerFromUrl} from 'lib/strings/embed-player'
import {cleanError} from '../../src/lib/strings/errors'
@@ -207,8 +208,10 @@ describe('ago', () => {
]
it('correctly calculates how much time passed, in a string', () => {
const i18n = new I18n({locale: 'en'})
for (let i = 0; i < inputs.length; i++) {
const result = ago(inputs[i])
const result = ago(i18n, inputs[i])
expect(result).toEqual(outputs[i])
}
})