Просмотр исходного кода

feat(admin-ui): Implement relative date filtering

Michael Bromley 2 лет назад
Родитель
Сommit
d07a5f34cd
21 измененных файлов с 327 добавлено и 116 удалено
  1. 46 46
      packages/admin-ui/i18n-coverage.json
  2. 24 7
      packages/admin-ui/src/lib/core/src/providers/data-table/data-table-filter-collection.ts
  3. 31 12
      packages/admin-ui/src/lib/core/src/providers/data-table/data-table-filter.ts
  4. 23 10
      packages/admin-ui/src/lib/core/src/shared/components/data-table-filter-label/data-table-filter-label.component.html
  5. 37 9
      packages/admin-ui/src/lib/core/src/shared/components/data-table-filters/data-table-filters.component.html
  6. 16 17
      packages/admin-ui/src/lib/core/src/shared/components/data-table-filters/data-table-filters.component.ts
  7. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/ar.json
  8. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/cs.json
  9. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/de.json
  10. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/en.json
  11. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/es.json
  12. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/fr.json
  13. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/he.json
  14. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/it.json
  15. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/pl.json
  16. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json
  17. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/pt_PT.json
  18. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/ru.json
  19. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/uk.json
  20. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json
  21. 10 1
      packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json

+ 46 - 46
packages/admin-ui/i18n-coverage.json

@@ -1,81 +1,81 @@
 {
-  "generatedOn": "2023-08-28T07:56:15.924Z",
-  "lastCommit": "0c5ce7d43ecbaf67da4254c25fe3562626072844",
+  "generatedOn": "2023-08-28T09:13:19.132Z",
+  "lastCommit": "8b52e6fc44c9ebe04d9f012c39b0d9ea4961c215",
   "translationStatus": {
     "ar": {
-      "tokenCount": 746,
-      "translatedCount": 745,
-      "percentage": 100
+      "tokenCount": 755,
+      "translatedCount": 746,
+      "percentage": 99
     },
     "cs": {
-      "tokenCount": 746,
-      "translatedCount": 550,
-      "percentage": 74
+      "tokenCount": 755,
+      "translatedCount": 551,
+      "percentage": 73
     },
     "de": {
-      "tokenCount": 746,
-      "translatedCount": 745,
-      "percentage": 100
+      "tokenCount": 755,
+      "translatedCount": 746,
+      "percentage": 99
     },
     "en": {
-      "tokenCount": 746,
-      "translatedCount": 745,
+      "tokenCount": 755,
+      "translatedCount": 754,
       "percentage": 100
     },
     "es": {
-      "tokenCount": 746,
-      "translatedCount": 745,
-      "percentage": 100
+      "tokenCount": 755,
+      "translatedCount": 746,
+      "percentage": 99
     },
     "fr": {
-      "tokenCount": 746,
-      "translatedCount": 741,
-      "percentage": 99
+      "tokenCount": 755,
+      "translatedCount": 742,
+      "percentage": 98
     },
     "he": {
-      "tokenCount": 746,
-      "translatedCount": 745,
-      "percentage": 100
+      "tokenCount": 755,
+      "translatedCount": 746,
+      "percentage": 99
     },
     "it": {
-      "tokenCount": 746,
-      "translatedCount": 575,
-      "percentage": 77
+      "tokenCount": 755,
+      "translatedCount": 576,
+      "percentage": 76
     },
     "pl": {
-      "tokenCount": 746,
-      "translatedCount": 385,
-      "percentage": 52
+      "tokenCount": 755,
+      "translatedCount": 386,
+      "percentage": 51
     },
     "pt_BR": {
-      "tokenCount": 746,
-      "translatedCount": 744,
-      "percentage": 100
+      "tokenCount": 755,
+      "translatedCount": 745,
+      "percentage": 99
     },
     "pt_PT": {
-      "tokenCount": 746,
-      "translatedCount": 584,
-      "percentage": 78
+      "tokenCount": 755,
+      "translatedCount": 585,
+      "percentage": 77
     },
     "ru": {
-      "tokenCount": 746,
-      "translatedCount": 745,
-      "percentage": 100
+      "tokenCount": 755,
+      "translatedCount": 746,
+      "percentage": 99
     },
     "uk": {
-      "tokenCount": 746,
-      "translatedCount": 574,
-      "percentage": 77
+      "tokenCount": 755,
+      "translatedCount": 575,
+      "percentage": 76
     },
     "zh_Hans": {
-      "tokenCount": 746,
-      "translatedCount": 520,
-      "percentage": 70
+      "tokenCount": 755,
+      "translatedCount": 521,
+      "percentage": 69
     },
     "zh_Hant": {
-      "tokenCount": 746,
-      "translatedCount": 365,
-      "percentage": 49
+      "tokenCount": 755,
+      "translatedCount": 366,
+      "percentage": 48
     }
   }
 }

+ 24 - 7
packages/admin-ui/src/lib/core/src/providers/data-table/data-table-filter-collection.ts

@@ -286,9 +286,13 @@ export class DataTableFilterCollection<FilterInput extends Record<string, any> =
             return val ? '1' : '0';
         } else if (filterWithValue.isDateRange()) {
             const val = filterWithValue.value;
-            const start = val.start ? new Date(val.start).getTime() : '';
-            const end = val.end ? new Date(val.end).getTime() : '';
-            return `${start},${end}`;
+            if (val.mode === 'relative') {
+                return `${val.mode},${val.relativeValue},${val.relativeUnit}`;
+            } else {
+                const start = val.start ? new Date(val.start).getTime() : '';
+                const end = val.end ? new Date(val.end).getTime() : '';
+                return `${start},${end}`;
+            }
         } else if (filterWithValue.isCustom()) {
             return filterWithValue.filter.type.serializeValue(filterWithValue.value);
         }
@@ -316,10 +320,23 @@ export class DataTableFilterCollection<FilterInput extends Record<string, any> =
             case 'boolean':
                 return value === '1';
             case 'dateRange':
-                const [startTimestamp, endTimestamp] = value.split(',');
-                const start = startTimestamp ? new Date(Number(startTimestamp)).toISOString() : '';
-                const end = endTimestamp ? new Date(Number(endTimestamp)).toISOString() : '';
-                return { start, end };
+                let mode = 'relative';
+                let relativeValue: number | undefined;
+                let relativeUnit: 'day' | 'month' | 'year' | undefined;
+                let start: string | undefined;
+                let end: string | undefined;
+                if (value.startsWith('relative')) {
+                    mode = 'relative';
+                    const [_, relativeValueStr, relativeUnitStr] = value.split(',');
+                    relativeValue = Number(relativeValueStr);
+                    relativeUnit = relativeUnitStr as 'day' | 'month' | 'year';
+                } else {
+                    mode = 'range';
+                    const [startTimestamp, endTimestamp] = value.split(',');
+                    start = startTimestamp ? new Date(Number(startTimestamp)).toISOString() : '';
+                    end = endTimestamp ? new Date(Number(endTimestamp)).toISOString() : '';
+                }
+                return { mode, relativeValue, relativeUnit, start, end };
             case 'custom':
                 return filter.type.deserializeValue(value);
             default:

+ 31 - 12
packages/admin-ui/src/lib/core/src/providers/data-table/data-table-filter.ts

@@ -1,6 +1,7 @@
 import { Type as ComponentType } from '@angular/core';
 import { LocalizedString } from '@vendure/common/lib/generated-types';
 import { assertNever } from '@vendure/common/lib/shared-utils';
+import dayjs from 'dayjs';
 import { FormInputComponent } from '../../common/component-registry-types';
 import {
     BooleanOperators,
@@ -62,7 +63,16 @@ export type KindValueMap = {
     };
     select: { raw: string[]; input: StringOperators };
     boolean: { raw: boolean; input: BooleanOperators };
-    dateRange: { raw: { start?: string; end?: string }; input: DateOperators };
+    dateRange: {
+        raw: {
+            mode: 'relative' | 'range';
+            relativeValue: number;
+            relativeUnit: 'day' | 'month' | 'year';
+            start?: string;
+            end?: string;
+        };
+        input: DateOperators;
+    };
     number: { raw: { operator: keyof NumberOperators; amount: number }; input: NumberOperators };
     custom: { raw: any; input: any };
 };
@@ -122,20 +132,29 @@ export class DataTableFilter<
                 };
             case 'dateRange': {
                 let dateOperators: DateOperators;
-                const start = value.start ?? undefined;
-                const end = value.end ?? undefined;
-                if (start && end) {
+                const mode = value.mode ?? 'relative';
+                if (mode === 'relative') {
+                    const relativeValue = value.relativeValue ?? 30;
+                    const relativeUnit = value.relativeUnit ?? 'day';
                     dateOperators = {
-                        between: { start, end },
-                    };
-                } else if (start) {
-                    dateOperators = {
-                        after: start,
+                        after: dayjs().subtract(relativeValue, relativeUnit).startOf('day').toISOString(),
                     };
                 } else {
-                    dateOperators = {
-                        before: end,
-                    };
+                    const start = value.start ?? undefined;
+                    const end = value.end ?? undefined;
+                    if (start && end) {
+                        dateOperators = {
+                            between: { start, end },
+                        };
+                    } else if (start) {
+                        dateOperators = {
+                            after: start,
+                        };
+                    } else {
+                        dateOperators = {
+                            before: end,
+                        };
+                    }
                 }
                 return dateOperators;
             }

+ 23 - 10
packages/admin-ui/src/lib/core/src/shared/components/data-table-filter-label/data-table-filter-label.component.html

@@ -31,16 +31,29 @@
         <span *ngIf="!filterWithValue?.value">{{ 'common.boolean-false' | translate }}</span>
     </ng-container>
     <ng-container *ngIf="filterWithValue.isDateRange()">
-        <span *ngIf="filterWithValue.value?.start && filterWithValue.value?.end">
-            {{ filterWithValue.value?.start | localeDate : 'shortDate' }} -
-            {{ filterWithValue.value?.end | localeDate : 'shortDate' }}
-        </span>
-        <span *ngIf="filterWithValue.value?.start && !filterWithValue.value?.end">
-            > {{ filterWithValue.value?.start | localeDate : 'shortDate' }}
-        </span>
-        <span *ngIf="filterWithValue.value?.end && !filterWithValue.value?.start">
-            < {{ filterWithValue.value?.end | localeDate : 'shortDate' }}
-        </span>
+        <ng-container *ngIf="filterWithValue.value.mode === 'relative'">
+            <span *ngIf="filterWithValue.value.relativeUnit === 'day'">
+                {{ 'datetime.relative-past-days' | translate: { count: filterWithValue.value.relativeValue } }}
+            </span>
+            <span *ngIf="filterWithValue.value.relativeUnit === 'month'">
+                {{ 'datetime.relative-past-months' | translate: { count: filterWithValue.value.relativeValue } }}
+            </span>
+            <span *ngIf="filterWithValue.value.relativeUnit === 'year'">
+                {{ 'datetime.relative-past-years' | translate: { count: filterWithValue.value.relativeValue } }}
+            </span>
+        </ng-container>
+        <ng-container *ngIf="filterWithValue.value.mode === 'range'">
+            <span *ngIf="filterWithValue.value?.start && filterWithValue.value?.end">
+                {{ filterWithValue.value?.start | localeDate : 'shortDate' }} -
+                {{ filterWithValue.value?.end | localeDate : 'shortDate' }}
+            </span>
+            <span *ngIf="filterWithValue.value?.start && !filterWithValue.value?.end">
+                > {{ filterWithValue.value?.start | localeDate : 'shortDate' }}
+            </span>
+            <span *ngIf="filterWithValue.value?.end && !filterWithValue.value?.start">
+                < {{ filterWithValue.value?.end | localeDate : 'shortDate' }}
+            </span>
+        </ng-container>
     </ng-container>
     <ng-container *ngIf="filterWithValue.isNumber()">
         <span *ngIf="filterWithValue.value?.operator === 'eq'"> = </span>

+ 37 - 9
packages/admin-ui/src/lib/core/src/shared/components/data-table-filters/data-table-filters.component.html

@@ -5,7 +5,9 @@
             <clr-icon shape="times" size="12"></clr-icon>
         </button>
         <button vdrDropdownTrigger class="">
-            <span *ngIf="state === 'new'">{{ 'common.add-filter' | translate }} <span class="filter-hotkey">f</span></span>
+            <span *ngIf="state === 'new'"
+                >{{ 'common.add-filter' | translate }} <span class="filter-hotkey">f</span></span
+            >
             <span *ngIf="state === 'active'">
                 <vdr-data-table-filter-label
                     [filterWithValue]="filterWithValue"
@@ -97,14 +99,40 @@
                     </div>
                     <div *ngSwitchCase="'dateRange'">
                         <div [formGroup]="formControl">
-                            <label>
-                                <div>{{ 'common.start-date' | translate }}</div>
-                            </label>
-                            <vdr-datetime-picker formControlName="start"></vdr-datetime-picker>
-                            <label>
-                                <div>{{ 'common.end-date' | translate }}</div>
-                            </label>
-                            <vdr-datetime-picker formControlName="end"></vdr-datetime-picker>
+                            <vdr-form-field [label]="'common.data-table-filter-date-mode' | translate">
+                                <select name="mode" formControlName="mode" class="mb-1">
+                                    <option value="relative">
+                                        {{ 'common.data-table-filter-date-relative' | translate }}
+                                    </option>
+                                    <option value="range">
+                                        {{ 'common.data-table-filter-date-range' | translate }}
+                                    </option>
+                                </select>
+                            </vdr-form-field>
+                            <ng-container *ngIf="formControl.get('mode')?.value === 'relative'">
+                                <div class="flex mt-2">
+                                    <vdr-form-field class="mr-1">
+                                        <input type="number" min="1" formControlName="relativeValue" />
+                                    </vdr-form-field>
+                                    <vdr-form-field>
+                                        <select name="mode" formControlName="relativeUnit">
+                                            <option value="day">{{ 'datetime.day' | translate }}</option>
+                                            <option value="month">{{ 'datetime.month' | translate }}</option>
+                                            <option value="year">{{ 'datetime.year' | translate }}</option>
+                                        </select>
+                                    </vdr-form-field>
+                                </div>
+                            </ng-container>
+                            <ng-container *ngIf="formControl.get('mode')?.value === 'range'">
+                                <label>
+                                    <div>{{ 'common.start-date' | translate }}</div>
+                                </label>
+                                <vdr-datetime-picker formControlName="start"></vdr-datetime-picker>
+                                <label>
+                                    <div>{{ 'common.end-date' | translate }}</div>
+                                </label>
+                                <vdr-datetime-picker formControlName="end"></vdr-datetime-picker>
+                            </ng-container>
                         </div>
                     </div>
                 </div>

+ 16 - 17
packages/admin-ui/src/lib/core/src/shared/components/data-table-filters/data-table-filters.component.ts

@@ -122,15 +122,19 @@ export class DataTableFiltersComponent implements AfterViewInit {
         } else if (filter.isDateRange()) {
             this.formControl = new FormGroup(
                 {
+                    mode: new FormControl('relative'),
+                    relativeValue: new FormControl(value?.relativeValue ?? 30),
+                    relativeUnit: new FormControl(value?.relativeUnit ?? 'day'),
                     start: new FormControl(value?.start ?? null),
                     end: new FormControl(value?.end ?? null),
                 },
                 control => {
                     const val = control.value;
-                    if (val.start && val.end && val.start > val.end) {
+                    const mode = val.mode;
+                    if (mode === 'range' && val.start && val.end && val.start > val.end) {
                         return { invalidRange: true };
                     }
-                    if (!val.start && !val.end) {
+                    if (mode === 'range' && !val.start && !val.end) {
                         return { noSelection: true };
                     }
                     return null;
@@ -158,23 +162,18 @@ export class DataTableFiltersComponent implements AfterViewInit {
                 value = !!this.formControl.value as KindValueMap[typeof type.kind]['raw'];
                 break;
             case 'dateRange': {
-                let dateOperators: DateOperators;
+                const mode = this.formControl.value.mode ?? 'relative';
+                const relativeValue = this.formControl.value.relativeValue ?? 30;
+                const relativeUnit = this.formControl.value.relativeUnit ?? 'day';
                 const start = this.formControl.value.start ?? undefined;
                 const end = this.formControl.value.end ?? undefined;
-                if (start && end) {
-                    dateOperators = {
-                        between: { start, end },
-                    };
-                } else if (start) {
-                    dateOperators = {
-                        after: start,
-                    };
-                } else {
-                    dateOperators = {
-                        before: end,
-                    };
-                }
-                value = { start, end } as KindValueMap[typeof type.kind]['raw'];
+                value = {
+                    mode,
+                    relativeValue,
+                    relativeUnit,
+                    start,
+                    end,
+                } as KindValueMap[typeof type.kind]['raw'];
                 break;
             }
             case 'number':

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/ar.json

@@ -224,6 +224,9 @@
     "create": "حفظ",
     "created-at": "أنشئت في",
     "custom-fields": "الحقول المخصصة",
+    "data-table-filter-date-mode": "نمط التاريخ",
+    "data-table-filter-date-range": "نطاق التاريخ",
+    "data-table-filter-date-relative": "تاريخ نسبي",
     "default-channel": "القناة الإفتراضية",
     "default-language": "اللغة الافتراضية",
     "default-tax-category": "فئة الضرائب الافتراضية",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {دقيقة واحدة} other {{count} دقيقة}} مضت",
     "ago-seconds": "{count, plural, =0 {just now} one {ثانية واحدة مضت} other {{count} ثواني مضت}}",
     "ago-years": "{count, plural, one {سنة واحدة} other {{count} سنين}} مضت",
+    "day": "يوم",
     "duration-milliseconds": "{MS} MS",
     "duration-minutes:seconds": "{m}: {s} m",
     "duration-seconds": "{s} s",
+    "month": "شهر",
     "month-apr": "أبريل",
     "month-aug": "أغسطس",
     "month-dec": "ديسمبر",
@@ -447,6 +452,9 @@
     "month-nov": "شهر نوفمبر",
     "month-oct": "اكتوبر",
     "month-sep": "سبتمبر",
+    "relative-past-days": "{count} {count, plural, one {يوم} other {أيام}} مضت",
+    "relative-past-months": "{count} {count, plural, one {شهر} other {أشهر}} مضت",
+    "relative-past-years": "{count} {count, plural, one {سنة} other {سنوات}} مضت",
     "time": "وقت",
     "weekday-fr": "الاب",
     "weekday-mo": "شهر",
@@ -454,7 +462,8 @@
     "weekday-su": "نكون",
     "weekday-th": "ذ",
     "weekday-tu": "تو",
-    "weekday-we": "نحن"
+    "weekday-we": "نحن",
+    "year": "سنة"
   },
   "editor": {
     "image-alt": "الوصف (بديل)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/cs.json

@@ -224,6 +224,9 @@
     "create": "Vytvořit",
     "created-at": "Vytvořeno",
     "custom-fields": "Extra pole",
+    "data-table-filter-date-mode": "Režim data",
+    "data-table-filter-date-range": "Rozsah dat",
+    "data-table-filter-date-relative": "Relativní datum",
     "default-channel": "Výchozí kanál",
     "default-language": "Výchozí jazyk",
     "default-tax-category": "",
@@ -432,9 +435,11 @@
     "ago-minutes": "před {count, plural, one {1 min} other {{count} min}}",
     "ago-seconds": "{count, plural, =0 {teď} one {1 sek} other {před {count} sek}}",
     "ago-years": "před {count, plural, one {1 year} other {{count} years}}",
+    "day": "den",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "měsíc",
     "month-apr": "Duben",
     "month-aug": "Srpen",
     "month-dec": "Prosinec",
@@ -447,6 +452,9 @@
     "month-nov": "Listopad",
     "month-oct": "Říjen",
     "month-sep": "Září",
+    "relative-past-days": "Minulých {count, plural, one {1 den} other {{count} dní}}",
+    "relative-past-months": "Minulých {count, plural, one {1 měsíc} other {{count} měsíců}}",
+    "relative-past-years": "Minulých {count, plural, one {1 rok} other {{count} let}}",
     "time": "Čas",
     "weekday-fr": "Pá",
     "weekday-mo": "Po",
@@ -454,7 +462,8 @@
     "weekday-su": "Ne",
     "weekday-th": "Čt",
     "weekday-tu": "Út",
-    "weekday-we": "St"
+    "weekday-we": "St",
+    "year": "rok"
   },
   "editor": {
     "image-alt": "Popisek (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/de.json

@@ -224,6 +224,9 @@
     "create": "Erstellen",
     "created-at": "Erstellt am",
     "custom-fields": "Benutzerdefinierte Felder",
+    "data-table-filter-date-mode": "Datumsmodus",
+    "data-table-filter-date-range": "Datumsbereich",
+    "data-table-filter-date-relative": "Relatives Datum",
     "default-channel": "Standardkanal",
     "default-language": "Standardsprache",
     "default-tax-category": "Standardsteuerkategorie",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {Vor einer Minute} other {Vor {count} Minuten}}",
     "ago-seconds": "{count, plural, =0 {Gerade eben} one {Vor einer Sekunde} other {Vor {count} Sekunden}}",
     "ago-years": "{count, plural, one {Vor einem Jahr} other {Vor {count} Jahren}}",
+    "day": "Tag",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "Monat",
     "month-apr": "April",
     "month-aug": "August",
     "month-dec": "Dezember",
@@ -447,6 +452,9 @@
     "month-nov": "November",
     "month-oct": "Oktober",
     "month-sep": "September",
+    "relative-past-days": "Vergangene {count, plural, one {1 Tag} other {{count} Tage}}",
+    "relative-past-months": "Vergangene {count, plural, one {1 Monat} other {{count} Monate}}",
+    "relative-past-years": "Vergangene {count, plural, one {1 Jahr} other {{count} Jahre}}",
     "time": "Zeit",
     "weekday-fr": "Fr",
     "weekday-mo": "Mo",
@@ -454,7 +462,8 @@
     "weekday-su": "So",
     "weekday-th": "Do",
     "weekday-tu": "Di",
-    "weekday-we": "Mi"
+    "weekday-we": "Mi",
+    "year": "Jahr"
   },
   "editor": {
     "image-alt": "Beschreibung ('alt')",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/en.json

@@ -224,6 +224,9 @@
     "create": "Create",
     "created-at": "Created at",
     "custom-fields": "Custom fields",
+    "data-table-filter-date-mode": "Date mode",
+    "data-table-filter-date-range": "Date range",
+    "data-table-filter-date-relative": "Relative date",
     "default-channel": "Default channel",
     "default-language": "Default language",
     "default-tax-category": "Default tax category",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 min} other {{count} mins}} ago",
     "ago-seconds": "{count, plural, =0 {just now} one {1 sec ago} other {{count} secs ago}}",
     "ago-years": "{count, plural, one {1 year} other {{count} years}} ago",
+    "day": "day",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "month",
     "month-apr": "April",
     "month-aug": "August",
     "month-dec": "December",
@@ -447,6 +452,9 @@
     "month-nov": "November",
     "month-oct": "October",
     "month-sep": "September",
+    "relative-past-days": "Past {count, plural, one {1 day} other {{count} days}}",
+    "relative-past-months": "Past {count, plural, one {1 month} other {{count} months}}",
+    "relative-past-years": "Past {count, plural, one {1 year} other {{count} years}}",
     "time": "Time",
     "weekday-fr": "Fr",
     "weekday-mo": "Mo",
@@ -454,7 +462,8 @@
     "weekday-su": "Su",
     "weekday-th": "Th",
     "weekday-tu": "Tu",
-    "weekday-we": "We"
+    "weekday-we": "We",
+    "year": "year"
   },
   "editor": {
     "image-alt": "Description (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/es.json

@@ -224,6 +224,9 @@
     "create": "Crear",
     "created-at": "Creado el",
     "custom-fields": "Campos personalizados",
+    "data-table-filter-date-mode": "Modo de fecha",
+    "data-table-filter-date-range": "Rango de fechas",
+    "data-table-filter-date-relative": "Fecha relativa",
     "default-channel": "Canal de ventas por defecto",
     "default-language": "Idioma por defecto",
     "default-tax-category": "Categoría de impuestos por defecto",
@@ -432,9 +435,11 @@
     "ago-minutes": "Hace {count, plural, one {1 min} other {{count} min}}",
     "ago-seconds": "{count, plural, =0 {Ahora mismo} one {Hace 1s} other {Hace {count}s}}",
     "ago-years": "Hace {count, plural, one {1 año} other {{count} años}}",
+    "day": "día",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "mes",
     "month-apr": "Abril",
     "month-aug": "Agosto",
     "month-dec": "Diciembre",
@@ -447,6 +452,9 @@
     "month-nov": "Noviembre",
     "month-oct": "Octubre",
     "month-sep": "Septiembre",
+    "relative-past-days": "{count} {count, plural, one {día} other {días}} atrás",
+    "relative-past-months": "{count} {count, plural, one {mes} other {meses}} atrás",
+    "relative-past-years": "{count} {count, plural, one {año} other {años}} atrás",
     "time": "Hora",
     "weekday-fr": "Vi",
     "weekday-mo": "Lu",
@@ -454,7 +462,8 @@
     "weekday-su": "Do",
     "weekday-th": "Ju",
     "weekday-tu": "Ma",
-    "weekday-we": "Mi"
+    "weekday-we": "Mi",
+    "year": "año"
   },
   "editor": {
     "image-alt": "Descripción (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/fr.json

@@ -224,6 +224,9 @@
     "create": "Créer",
     "created-at": "Créé à",
     "custom-fields": "Champs personnalisés",
+    "data-table-filter-date-mode": "Mode de date",
+    "data-table-filter-date-range": "Plage de dates",
+    "data-table-filter-date-relative": "Date relative",
     "default-channel": "Canal par défaut",
     "default-language": "Langue par défaut",
     "default-tax-category": "Catégorie de taxe par défaut",
@@ -432,9 +435,11 @@
     "ago-minutes": "Il y a {count, plural, one {1 min} other {{count} mins}}",
     "ago-seconds": "Il y a {count, plural, =0 {just now} one {1 sec} other {{count} secs}}",
     "ago-years": "Il y a {count, plural, one {1 an} other {{count} ans}}",
+    "day": "jour",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "mois",
     "month-apr": "Avril",
     "month-aug": "Août",
     "month-dec": "Décembre",
@@ -447,6 +452,9 @@
     "month-nov": "Novembre",
     "month-oct": "Octobre",
     "month-sep": "Septembre",
+    "relative-past-days": "{count} {count, plural, one {jour} other {jours}} passés",
+    "relative-past-months": "{count} {count, plural, one {mois} other {mois}} passés",
+    "relative-past-years": "{count} {count, plural, one {an} other {ans}} passés",
     "time": "Temps",
     "weekday-fr": "Vendredi",
     "weekday-mo": "Lundi",
@@ -454,7 +462,8 @@
     "weekday-su": "Dimanche",
     "weekday-th": "Jeudi",
     "weekday-tu": "Mardi",
-    "weekday-we": "Mercredi"
+    "weekday-we": "Mercredi",
+    "year": "an"
   },
   "editor": {
     "image-alt": "Description (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/he.json

@@ -224,6 +224,9 @@
     "create": "צור",
     "created-at": "נוצר ב",
     "custom-fields": "שדות מותאמים אישית",
+    "data-table-filter-date-mode": "מצב תאריך",
+    "data-table-filter-date-range": "טווח תאריכים",
+    "data-table-filter-date-relative": "תאריך יחסי",
     "default-channel": "ערוץ ברירת מחדל",
     "default-language": "שפת ברירת מחדל",
     "default-tax-category": "קטגוריית מס ברירת מחדל",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {לפני דקה 1} other {{count} דקות}}",
     "ago-seconds": "{count, plural, =0 {ממש עכשיו} one {לפני שנייה 1} other {{count} שניות}}",
     "ago-years": "{count, plural, one {לפני שנה 1} other {{count} שנים}}",
+    "day": "יום",
     "duration-milliseconds": "{ms} מס",
     "duration-minutes:seconds": "{m}:{s} דק'",
     "duration-seconds": "{s} שנ'",
+    "month": "חודש",
     "month-apr": "אפריל",
     "month-aug": "אוגוסט",
     "month-dec": "דצמבר",
@@ -447,6 +452,9 @@
     "month-nov": "נובמבר",
     "month-oct": "אוקטובר",
     "month-sep": "ספטמבר",
+    "relative-past-days": "לפני {count} {count, plural, one {יום} other {ימים}}",
+    "relative-past-months": "לפני {count} {count, plural, one {חודש} other {חודשים}}",
+    "relative-past-years": "לפני {count} {count, plural, one {שנה} other {שנים}}",
     "time": "זמן",
     "weekday-fr": "יום ו'",
     "weekday-mo": "יום ב'",
@@ -454,7 +462,8 @@
     "weekday-su": "יום א'",
     "weekday-th": "יום ה'",
     "weekday-tu": "יום ג'",
-    "weekday-we": "יום ד'"
+    "weekday-we": "יום ד'",
+    "year": "שנה"
   },
   "editor": {
     "image-alt": "תיאור (טקסט חלופי)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/it.json

@@ -224,6 +224,9 @@
     "create": "Crea",
     "created-at": "Creato il",
     "custom-fields": "Campi personalizzati",
+    "data-table-filter-date-mode": "Modalità data",
+    "data-table-filter-date-range": "Intervallo date",
+    "data-table-filter-date-relative": "Data relativa",
     "default-channel": "Canale predefinito",
     "default-language": "Lingua predefinita",
     "default-tax-category": "Categoria tasse predefinita",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 min} other {{count} min}} fa",
     "ago-seconds": "{count, plural, =0 {proprio ora} one {1 sec fa} other {{count} sec fa}}",
     "ago-years": "{count, plural, one {1 anno} other {{count} anni}} fa",
+    "day": "giorno",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}",
+    "month": "mese",
     "month-apr": "Aprile",
     "month-aug": "Agosto",
     "month-dec": "Dicembre",
@@ -447,6 +452,9 @@
     "month-nov": "Novembre",
     "month-oct": "Ottobre",
     "month-sep": "Settembre",
+    "relative-past-days": "{count} {count, plural, one {giorno} other {giorni}} fa",
+    "relative-past-months": "{count} {count, plural, one {mese} other {mesi}} fa",
+    "relative-past-years": "{count} {count, plural, one {anno} other {anni}} fa",
     "time": "Ora",
     "weekday-fr": "Ve",
     "weekday-mo": "Lu",
@@ -454,7 +462,8 @@
     "weekday-su": "Do",
     "weekday-th": "Gi",
     "weekday-tu": "Ma",
-    "weekday-we": "Me"
+    "weekday-we": "Me",
+    "year": "anno"
   },
   "editor": {
     "image-alt": "Descrizione (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/pl.json

@@ -224,6 +224,9 @@
     "create": "Utwórz",
     "created-at": "Utworzone dnia",
     "custom-fields": "Dodatkowe pola",
+    "data-table-filter-date-mode": "Tryb daty",
+    "data-table-filter-date-range": "Zakres dat",
+    "data-table-filter-date-relative": "Data względna",
     "default-channel": "Domyślny kanał",
     "default-language": "Domyślny jezyk",
     "default-tax-category": "",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 minutę} other {{count} minut}} temu",
     "ago-seconds": "{count, plural, =0 {przed chwilą} one {1 sekundę temu} other {{count} sekund temu}}",
     "ago-years": "",
+    "day": "dzień",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "miesiąc",
     "month-apr": "Kwiecień",
     "month-aug": "Sierpień",
     "month-dec": "Grudzień",
@@ -447,6 +452,9 @@
     "month-nov": "Listopad",
     "month-oct": "Październik",
     "month-sep": "Wrzesień",
+    "relative-past-days": "Minęło {count} {count, plural, one {1 dzień} few {{count} dni} many {{count} dni} other {{count} dni}}",
+    "relative-past-months": "Minęło {count} {count, plural, one {1 miesiąc} few {{count} miesiące} many {{count} miesięcy} other {{count} miesięcy}}",
+    "relative-past-years": "Minęło {count} {count, plural, one {1 rok} few {{count} lata} many {{count} lat} other {{count} lat}}",
     "time": "Czas",
     "weekday-fr": "Pt",
     "weekday-mo": "Pon",
@@ -454,7 +462,8 @@
     "weekday-su": "Nd",
     "weekday-th": "Czw",
     "weekday-tu": "Wt",
-    "weekday-we": "Śr"
+    "weekday-we": "Śr",
+    "year": "rok"
   },
   "editor": {
     "image-alt": "Opis (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json

@@ -224,6 +224,9 @@
     "create": "Criar",
     "created-at": "Criado em",
     "custom-fields": "Campos customizados",
+    "data-table-filter-date-mode": "Modo de data",
+    "data-table-filter-date-range": "Intervalo de datas",
+    "data-table-filter-date-relative": "Data relativa",
     "default-channel": "Canal padrão",
     "default-language": "Idioma padrão",
     "default-tax-category": "Categoria de imposto padrão",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 min} other {{count} mins}} atrás",
     "ago-seconds": "{count, plural, =0 {agora} one {1 segundo atrás} other {{count} 1 segundos atrás}}",
     "ago-years": "{count, plural, one {1 ano} other {{count} anos}} atrás",
+    "day": "dia",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "mês",
     "month-apr": "Abril",
     "month-aug": "Agosto",
     "month-dec": "Dezembro",
@@ -447,6 +452,9 @@
     "month-nov": "Novembro",
     "month-oct": "Outubro",
     "month-sep": "Setembro",
+    "relative-past-days": "{count} {count, plural, one {dia} other {dias}} atrás",
+    "relative-past-months": "{count} {count, plural, one {mês} other {meses}} atrás",
+    "relative-past-years": "{count} {count, plural, one {ano} other {anos}} atrás",
     "time": "Tempo",
     "weekday-fr": "Sex",
     "weekday-mo": "Seg",
@@ -454,7 +462,8 @@
     "weekday-su": "Dom",
     "weekday-th": "Qui",
     "weekday-tu": "Ter",
-    "weekday-we": "Qua"
+    "weekday-we": "Qua",
+    "year": "ano"
   },
   "editor": {
     "image-alt": "Descrição (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/pt_PT.json

@@ -224,6 +224,9 @@
     "create": "Adicionar",
     "created-at": "Adicionado em",
     "custom-fields": "Campos customizados",
+    "data-table-filter-date-mode": "Modo de data",
+    "data-table-filter-date-range": "Intervalo de datas",
+    "data-table-filter-date-relative": "Data relativa",
     "default-channel": "Canal padrão",
     "default-language": "Idioma padrão",
     "default-tax-category": "Categoria de imposto padrão",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 minuto} other {{count} minutos}} atrás",
     "ago-seconds": "{count, plural, =0 {just now} one {há 1 segundo} other {há {count} segundos}}",
     "ago-years": "{count, plural, one {1 ano} other {{count} anos}} atrás",
+    "day": "dia",
     "duration-milliseconds": "{ms}ms",
     "duration-minutes:seconds": "{m}:{s}m",
     "duration-seconds": "{s}s",
+    "month": "mês",
     "month-apr": "Abril",
     "month-aug": "Agosto",
     "month-dec": "Dezembro",
@@ -447,6 +452,9 @@
     "month-nov": "Novembro",
     "month-oct": "Outubro",
     "month-sep": "Setembro",
+    "relative-past-days": "{count} {count, plural, one {dia} other {dias}} atrás",
+    "relative-past-months": "{count} {count, plural, one {mês} other {meses}} atrás",
+    "relative-past-years": "{count} {count, plural, one {ano} other {anos}} atrás",
     "time": "Tempo",
     "weekday-fr": "Sex",
     "weekday-mo": "Seg",
@@ -454,7 +462,8 @@
     "weekday-su": "Dom",
     "weekday-th": "Qui",
     "weekday-tu": "Ter",
-    "weekday-we": "Qua"
+    "weekday-we": "Qua",
+    "year": "ano"
   },
   "editor": {
     "image-alt": "Descrição (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/ru.json

@@ -224,6 +224,9 @@
     "create": "Создать",
     "created-at": "Создано в",
     "custom-fields": "Произвольные поля",
+    "data-table-filter-date-mode": "Режим даты",
+    "data-table-filter-date-range": "Диапазон дат",
+    "data-table-filter-date-relative": "Относительная дата",
     "default-channel": "Канал по умолчанию",
     "default-language": "Язык по умолчанию",
     "default-tax-category": "Категория налога по умолчанию",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 минуту} other {{count} минут}} тому",
     "ago-seconds": "{count, plural, =0 {прямо сейчас} one {1 секунду тому} other {{count} секунд тому}}",
     "ago-years": "{count, plural, one {1 год} other {{count} лет}} тому",
+    "day": "день",
     "duration-milliseconds": "{ms}мс",
     "duration-minutes:seconds": "{m}:{s}мин",
     "duration-seconds": "{s}сек",
+    "month": "месяц",
     "month-apr": "Апрель",
     "month-aug": "Август",
     "month-dec": "Декабрь",
@@ -447,6 +452,9 @@
     "month-nov": "Ноябрь",
     "month-oct": "Октябрь",
     "month-sep": "Сентябрь",
+    "relative-past-days": "{count} {count, plural, one {день} other {дней}} назад",
+    "relative-past-months": "{count} {count, plural, one {месяц} other {месяцев}} назад",
+    "relative-past-years": "{count} {count, plural, one {год} other {лет}} назад",
     "time": "Время",
     "weekday-fr": "Пт",
     "weekday-mo": "Пн",
@@ -454,7 +462,8 @@
     "weekday-su": "Вс",
     "weekday-th": "Чт",
     "weekday-tu": "Вт",
-    "weekday-we": "Ср"
+    "weekday-we": "Ср",
+    "year": "год"
   },
   "editor": {
     "image-alt": "Описание (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/uk.json

@@ -224,6 +224,9 @@
     "create": "Створити",
     "created-at": "Створено в",
     "custom-fields": "Настроювані поля",
+    "data-table-filter-date-mode": "Режим дати",
+    "data-table-filter-date-range": "Діапазон дат",
+    "data-table-filter-date-relative": "Відносна дата",
     "default-channel": "Канал за замовчуванням",
     "default-language": "Мова за замовчуванням",
     "default-tax-category": "Категорія податку за замовчуванням",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count, plural, one {1 хвилину} other {{count} хвилин}} тому",
     "ago-seconds": "{count, plural, =0 {прямо зараз} one {1 секунду тому} other {{count} секунд тому}}",
     "ago-years": "{count, plural, one {1 рік} other {{count} років}} тому",
+    "day": "день",
     "duration-milliseconds": "{ms}мс",
     "duration-minutes:seconds": "{m}:{s}х",
     "duration-seconds": "{s}с",
+    "month": "місяць",
     "month-apr": "Квітень",
     "month-aug": "Серпень",
     "month-dec": "Грудень",
@@ -447,6 +452,9 @@
     "month-nov": "Листопад",
     "month-oct": "Жовтень",
     "month-sep": "Вересень",
+    "relative-past-days": "Минуло {count} {count, plural, one {день} few {дні} many {днів} other {днів}} тому",
+    "relative-past-months": "Минуло {count} {count, plural, one {місяць} few {місяці} many {місяців} other {місяців}} тому",
+    "relative-past-years": "Минуло {count} {count, plural, one {рік} few {роки} many {років} other {років}} тому",
     "time": "Час",
     "weekday-fr": "Пт",
     "weekday-mo": "Пн",
@@ -454,7 +462,8 @@
     "weekday-su": "Нд",
     "weekday-th": "Чт",
     "weekday-tu": "Вт",
-    "weekday-we": "Ср"
+    "weekday-we": "Ср",
+    "year": "рік"
   },
   "editor": {
     "image-alt": "Опис (alt)",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json

@@ -224,6 +224,9 @@
     "create": "添加",
     "created-at": "创建时间",
     "custom-fields": "客户化字段",
+    "data-table-filter-date-mode": "日期模式",
+    "data-table-filter-date-range": "日期范围",
+    "data-table-filter-date-relative": "相对日期",
     "default-channel": "默认销售渠道",
     "default-language": "默认语言",
     "default-tax-category": "默认税表",
@@ -432,9 +435,11 @@
     "ago-minutes": "{count}分钟前",
     "ago-seconds": "{count, plural, =0 {刚刚} other {{count} 秒前}}",
     "ago-years": "{count, plural, =1 {去年} other {{count} 年前}} ",
+    "day": "天",
     "duration-milliseconds": "{ms}毫秒",
     "duration-minutes:seconds": "{m}分{s}秒",
     "duration-seconds": "{s}秒",
+    "month": "月",
     "month-apr": "4月",
     "month-aug": "8月",
     "month-dec": "12月",
@@ -447,6 +452,9 @@
     "month-nov": "11月",
     "month-oct": "10月",
     "month-sep": "9月",
+    "relative-past-days": "过去{count}天",
+    "relative-past-months": "过去{count}个月",
+    "relative-past-years": "过去{count}年",
     "time": "时间",
     "weekday-fr": "星期五",
     "weekday-mo": "星期一",
@@ -454,7 +462,8 @@
     "weekday-su": "星期日",
     "weekday-th": "星期四",
     "weekday-tu": "星期二",
-    "weekday-we": "星期三"
+    "weekday-we": "星期三",
+    "year": "年"
   },
   "editor": {
     "image-alt": "图片备注",

+ 10 - 1
packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json

@@ -224,6 +224,9 @@
     "create": "新增",
     "created-at": "建立時間",
     "custom-fields": "客戶自訂欄位",
+    "data-table-filter-date-mode": "日期模式",
+    "data-table-filter-date-range": "日期範圍",
+    "data-table-filter-date-relative": "相對日期",
     "default-channel": "默認渠道",
     "default-language": "",
     "default-tax-category": "",
@@ -432,9 +435,11 @@
     "ago-minutes": "",
     "ago-seconds": "",
     "ago-years": "",
+    "day": "天",
     "duration-milliseconds": "",
     "duration-minutes:seconds": "",
     "duration-seconds": "",
+    "month": "月",
     "month-apr": "4月",
     "month-aug": "8月",
     "month-dec": "12月",
@@ -447,6 +452,9 @@
     "month-nov": "11月",
     "month-oct": "10月",
     "month-sep": "9月",
+    "relative-past-days": "过去{count}天",
+    "relative-past-months": "过去{count}个月",
+    "relative-past-years": "过去{count}年",
     "time": "時間",
     "weekday-fr": "星期五",
     "weekday-mo": "星期一",
@@ -454,7 +462,8 @@
     "weekday-su": "星期日",
     "weekday-th": "星期四",
     "weekday-tu": "星期二",
-    "weekday-we": "星期三"
+    "weekday-we": "星期三",
+    "year": "年"
   },
   "editor": {
     "image-alt": "圖片備注",