0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-04-05 08:44:50 +02:00

Fix "toAbsoluteLocaleDate" test when system locale is not en-US (#33939)

This commit is contained in:
YaFou 2025-03-19 12:49:05 +01:00 committed by GitHub
parent 39fc2e7285
commit e25f860735
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,7 @@ test('toAbsoluteLocaleDate', () => {
// test different timezone
const oldTZ = process.env.TZ;
process.env.TZ = 'America/New_York';
expect(new Date('2024-03-15').toLocaleString()).toEqual('3/14/2024, 8:00:00 PM');
expect(toAbsoluteLocaleDate('2024-03-15')).toEqual('3/15/2024, 12:00:00 AM');
expect(new Date('2024-03-15').toLocaleString('en-US')).toEqual('3/14/2024, 8:00:00 PM');
expect(toAbsoluteLocaleDate('2024-03-15', 'en-US')).toEqual('3/15/2024, 12:00:00 AM');
process.env.TZ = oldTZ;
});