{
- return typeof (thing as SCSaveableThing).data !== 'undefined';
+ thing: SCThings | SCSaveableThing,
+ ): thing is SCSaveableThing {
+ return typeof (thing as SCSaveableThing).data !== 'undefined';
}
/**
diff --git a/src/app/modules/data/types/date-series/date-series-list-item.html b/src/app/modules/data/types/date-series/date-series-list-item.html
index c0417ec6..7360d13f 100644
--- a/src/app/modules/data/types/date-series/date-series-list-item.html
+++ b/src/app/modules/data/types/date-series/date-series-list-item.html
@@ -6,7 +6,8 @@
- {{ item.frequency }}, {{ item.dates[0] | amDateFormat: 'dddd' }}
+ {{ item.repeatFrequency | amDuration }},
+ {{ item.dates[0] | amDateFormat: 'dddd' }}
({{ item.dates[0] | amDateFormat: 'll' }} -
{{
diff --git a/src/app/modules/news/item/news-item.html b/src/app/modules/news/item/news-item.html
index dcb2de4d..6ae5544f 100644
--- a/src/app/modules/news/item/news-item.html
+++ b/src/app/modules/news/item/news-item.html
@@ -1,6 +1,6 @@
-
-
+
+
- {{ item.name }}.
+ -->
+
-
- {{ scheduleEvent.dateSeries.frequency }}
- until
+
+ {{ 'schedule.card.forEach' | translate }}
+ {{ scheduleEvent.dateSeries.repeatFrequency | amDuration }}
+ {{ 'schedule.card.until' | translate }}
{{
scheduleEvent.dateSeries.dates | last | amDateFormat: 'DD. MMM YYYY'
}}
diff --git a/src/app/modules/schedule/page/schedule-single-events.component.ts b/src/app/modules/schedule/page/schedule-single-events.component.ts
index 4406ad9a..1cab65e8 100644
--- a/src/app/modules/schedule/page/schedule-single-events.component.ts
+++ b/src/app/modules/schedule/page/schedule-single-events.component.ts
@@ -14,7 +14,7 @@
*/
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {SCDateSeries, SCUuid} from '@openstapps/core';
-import {flatMap, groupBy, omit, sortBy} from 'lodash-es';
+import {flatMap, groupBy, isNil, omit, sortBy} from 'lodash-es';
import moment from 'moment';
import {Subscription} from 'rxjs';
import {materialFade} from '../../../animation/material-motion';
@@ -115,7 +115,7 @@ export class ScheduleSingleEventsComponent implements OnInit, OnDestroy {
// TODO: replace with filter
return ScheduleSingleEventsComponent.groupDateSeriesToDays(
- dateSeries.filter(it => it.frequency === 'single'),
+ dateSeries.filter(it => isNil(it.repeatFrequency)),
);
}
diff --git a/src/app/modules/schedule/schedule.provider.ts b/src/app/modules/schedule/schedule.provider.ts
index a0666399..b917c93a 100644
--- a/src/app/modules/schedule/schedule.provider.ts
+++ b/src/app/modules/schedule/schedule.provider.ts
@@ -1,6 +1,5 @@
-/* eslint-disable unicorn/no-null */
/*
- * Copyright (C) 2018-2020 StApps
+ * Copyright (C) 2021 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
@@ -13,11 +12,14 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see .
*/
+
+/* eslint-disable unicorn/no-null */
import {Injectable, OnDestroy} from '@angular/core';
import {
Bounds,
SCDateSeries,
SCISO8601Date,
+ SCISO8601Duration,
SCSearchFilter,
SCThingType,
SCUuid,
@@ -102,7 +104,7 @@ export class ScheduleProvider implements OnDestroy {
*/
async getDateSeries(
uuids: SCUuid[],
- frequencies?: Array<'single' | 'weekly' | 'biweekly'>,
+ frequencies?: Array,
from?: SCISO8601Date | 'now',
to?: SCISO8601Date | 'now',
): Promise {
@@ -138,7 +140,7 @@ export class ScheduleProvider implements OnDestroy {
arguments: {
filters: frequencies.map(frequency => ({
arguments: {
- field: 'frequency',
+ field: 'repeatFrequency',
value: frequency,
},
type: 'value',
diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json
index 546b0b9c..b2bcc5f5 100644
--- a/src/assets/i18n/de.json
+++ b/src/assets/i18n/de.json
@@ -38,7 +38,8 @@
"popover": {
"ALL": "Alle Termine",
"AT": "um",
- "UNTIL": "bis"
+ "UNTIL": "bis",
+ "SINGLE": "Einzel"
}
}
},
@@ -127,6 +128,10 @@
"addEventModal": {
"close": "Schließen",
"addEvent": "Events Hinzufügen"
+ },
+ "card": {
+ "forEach": "Alle",
+ "until": "bis"
}
},
"chips": {
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index d01337f2..320c2a06 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -38,7 +38,8 @@
"popover": {
"ALL": "All Events",
"AT": "at",
- "UNTIL": "until"
+ "UNTIL": "until",
+ "SINGLE": "single"
}
}
},
@@ -127,6 +128,10 @@
"addEventModal": {
"close": "close",
"addEvent": "Add Events"
+ },
+ "card": {
+ "forEach": "Every",
+ "until": "until"
}
},
"chips": {