mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Fix: tweak relative date
This commit is contained in:
@@ -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,
|
||||
},
|
||||
|
Reference in New Issue
Block a user