mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 16:25:33 +01:00
Fix: tweak relative date
This commit is contained in:
parent
90731e05f5
commit
9153be489c
3 changed files with 20 additions and 24 deletions
|
|
@ -39,10 +39,12 @@ describe('CustomDatePipe', () => {
|
|||
const now = new Date()
|
||||
const notNow = new Date(now)
|
||||
notNow.setDate(now.getDate() - 1)
|
||||
expect(datePipe.transform(notNow, 'relative')).toEqual('1 day ago')
|
||||
expect(datePipe.transform(notNow, 'relative')).toEqual('Yesterday')
|
||||
notNow.setDate(now.getDate())
|
||||
notNow.setMonth(now.getMonth() - 1)
|
||||
expect(datePipe.transform(notNow, 'relative')).toEqual('1 month ago')
|
||||
expect(datePipe.transform(notNow, 'relative')).toEqual(
|
||||
now.getMonth() > 1 ? 'Last month' : 'Last year'
|
||||
)
|
||||
expect(datePipe.transform(now, 'relative')).toEqual('Just now')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -11,22 +11,22 @@ const FORMAT_TO_ISO_FORMAT = {
|
|||
|
||||
const INTERVALS = {
|
||||
year: {
|
||||
label: $localize`%s year ago`,
|
||||
label: $localize`Last year`,
|
||||
labelPlural: $localize`%s years ago`,
|
||||
interval: 31536000,
|
||||
},
|
||||
month: {
|
||||
label: $localize`%s month ago`,
|
||||
label: $localize`Last month`,
|
||||
labelPlural: $localize`%s months ago`,
|
||||
interval: 2592000,
|
||||
},
|
||||
week: {
|
||||
label: $localize`%s week ago`,
|
||||
label: $localize`Last week`,
|
||||
labelPlural: $localize`%s weeks ago`,
|
||||
interval: 604800,
|
||||
},
|
||||
day: {
|
||||
label: $localize`%s day ago`,
|
||||
label: $localize`Yesterday`,
|
||||
labelPlural: $localize`%s days ago`,
|
||||
interval: 86400,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue