mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Fix: handle very old dates with positive offset too (#8335)
This commit is contained in:
parent
447b4cdb98
commit
be684c9a11
@ -77,14 +77,19 @@ describe('CorrespondentListComponent', () => {
|
|||||||
it('should support very old date strings', () => {
|
it('should support very old date strings', () => {
|
||||||
jest.spyOn(correspondentsService, 'listFiltered').mockReturnValue(
|
jest.spyOn(correspondentsService, 'listFiltered').mockReturnValue(
|
||||||
of({
|
of({
|
||||||
count: 1,
|
count: 2,
|
||||||
all: [1],
|
all: [1, 2],
|
||||||
results: [
|
results: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'Correspondent1',
|
name: 'Correspondent1',
|
||||||
last_correspondence: '1832-12-31T15:32:54-07:52:58',
|
last_correspondence: '1832-12-31T15:32:54-07:52:58',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: 'Correspondent2',
|
||||||
|
last_correspondence: '1901-07-01T00:00:00+00:09:21',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -52,7 +52,7 @@ export class CorrespondentListComponent extends ManagementListComponent<Correspo
|
|||||||
date = new Date(
|
date = new Date(
|
||||||
c.last_correspondence
|
c.last_correspondence
|
||||||
?.toString()
|
?.toString()
|
||||||
.replace(/-(\d\d):\d\d:\d\d/gm, `-$1:00`)
|
.replace(/([-+])(\d\d):\d\d:\d\d/gm, `$1$2:00`)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return this.datePipe.transform(date)
|
return this.datePipe.transform(date)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user