From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 9 May 2023 05:08:22 +0000 (-0700) Subject: Add explanations to relative dates X-Git-Tag: v1.15.0~1^2~15^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3471%2Fhead;p=thirdparty%2Fpaperless-ngx.git Add explanations to relative dates --- diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index fae98b3c01..e3926c578f 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -741,11 +741,11 @@ src/app/components/common/date-dropdown/date-dropdown.component.html - 24 + 33 src/app/components/common/date-dropdown/date-dropdown.component.html - 47 + 56 @@ -789,18 +789,25 @@ 440 + + now + + src/app/components/common/date-dropdown/date-dropdown.component.html + 20 + + After src/app/components/common/date-dropdown/date-dropdown.component.html - 19 + 28 Before src/app/components/common/date-dropdown/date-dropdown.component.html - 42 + 51 @@ -814,21 +821,21 @@ Last month src/app/components/common/date-dropdown/date-dropdown.component.ts - 47 + 48 Last 3 months src/app/components/common/date-dropdown/date-dropdown.component.ts - 51 + 53 Last year src/app/components/common/date-dropdown/date-dropdown.component.ts - 55 + 58 diff --git a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.html b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.html index 05547fed67..ad790821e4 100644 --- a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.html +++ b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.html @@ -5,13 +5,22 @@ - - - + + + - {{rd.name}} + + + {{rd.name}} + + + + {{ rd.date | customDate:'mediumDate' }} – now + + + diff --git a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.scss b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.scss index 8573ab5754..83ac932338 100644 --- a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.scss +++ b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.scss @@ -1,5 +1,5 @@ .date-dropdown { - min-width: 250px; + white-space: nowrap; .btn-link { line-height: 1; diff --git a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts index e901acfeb8..423bf4a684 100644 --- a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts +++ b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts @@ -39,20 +39,24 @@ export class DateDropdownComponent implements OnInit, OnDestroy { relativeDates = [ { - date: RelativeDate.LAST_7_DAYS, + id: RelativeDate.LAST_7_DAYS, name: $localize`Last 7 days`, + date: new Date().setDate(new Date().getDate() - 7), }, { - date: RelativeDate.LAST_MONTH, + id: RelativeDate.LAST_MONTH, name: $localize`Last month`, + date: new Date().setMonth(new Date().getMonth() - 1), }, { - date: RelativeDate.LAST_3_MONTHS, + id: RelativeDate.LAST_3_MONTHS, name: $localize`Last 3 months`, + date: new Date().setMonth(new Date().getMonth() - 3), }, { - date: RelativeDate.LAST_YEAR, + id: RelativeDate.LAST_YEAR, name: $localize`Last year`, + date: new Date().setFullYear(new Date().getFullYear() - 1), }, ]