Skip to content
Snippets Groups Projects
Commit cb950af8 authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel
Browse files

Merge branch '568-additional-default-period-for-time-filter-last-14-days' into 'master'

Add new time period 'last 14 days'

Closes #568

See merge request arsnova/frag.jetzt!508
parents d30881c4 d578a640
No related merge requests found
...@@ -29,6 +29,7 @@ export enum Period { ...@@ -29,6 +29,7 @@ export enum Period {
THREEHOURS = 'time-3h', THREEHOURS = 'time-3h',
ONEDAY = 'time-1d', ONEDAY = 'time-1d',
ONEWEEK = 'time-1w', ONEWEEK = 'time-1w',
TWOWEEKS = 'time-2w',
ALL = 'time-all' ALL = 'time-all'
} }
...@@ -488,6 +489,10 @@ export class CommentListComponent implements OnInit, OnDestroy { ...@@ -488,6 +489,10 @@ export class CommentListComponent implements OnInit, OnDestroy {
break; break;
case Period.ONEWEEK: case Period.ONEWEEK:
periodInSeconds = hourInSeconds * 168; periodInSeconds = hourInSeconds * 168;
break;
case Period.TWOWEEKS:
periodInSeconds = hourInSeconds * 336;
break;
} }
this.commentsFilteredByTime = this.comments this.commentsFilteredByTime = this.comments
.filter(c => new Date(c.timestamp).getTime() >= (currentTime.getTime() - periodInSeconds)); .filter(c => new Date(c.timestamp).getTime() >= (currentTime.getTime() - periodInSeconds));
......
...@@ -344,6 +344,10 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy { ...@@ -344,6 +344,10 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy {
break; break;
case Period.ONEWEEK: case Period.ONEWEEK:
periodInSeconds = hourInSeconds * 168; periodInSeconds = hourInSeconds * 168;
break;
case Period.TWOWEEKS:
periodInSeconds = hourInSeconds * 336;
break;
} }
this.commentsFilteredByTime = this.comments this.commentsFilteredByTime = this.comments
.filter(c => new Date(c.date).getTime() >= (currentTime.getTime() - periodInSeconds)); .filter(c => new Date(c.date).getTime() >= (currentTime.getTime() - periodInSeconds));
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"a11y-select-time-3h": "Zeige alle Kommentare der letzten 3 Stunden an", "a11y-select-time-3h": "Zeige alle Kommentare der letzten 3 Stunden an",
"a11y-select-time-1d": "Zeige alle Kommentare der letzten 24 Stunden an", "a11y-select-time-1d": "Zeige alle Kommentare der letzten 24 Stunden an",
"a11y-select-time-1w": "Zeige alle kommentare der letzten 7 Tage an", "a11y-select-time-1w": "Zeige alle kommentare der letzten 7 Tage an",
"a11y-select-time-2w": "Zeige alle kommentare der letzten 14 Tage an",
"a11y-select-time-all": "Zeige alle Kommentare an", "a11y-select-time-all": "Zeige alle Kommentare an",
"add-comment": "Frage oder Mitteilung ans Publikum schreiben …", "add-comment": "Frage oder Mitteilung ans Publikum schreiben …",
"answered": "Beantwortete Fragen", "answered": "Beantwortete Fragen",
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
"select-time-3h": "Letzte 2 Stunden", "select-time-3h": "Letzte 2 Stunden",
"select-time-1d": "Letzte 24 Stunden", "select-time-1d": "Letzte 24 Stunden",
"select-time-1w": "Letzte 7 Tage", "select-time-1w": "Letzte 7 Tage",
"select-time-2w": "Letzte 14 Tage",
"select-time-all": "Unbegrenzt" "select-time-all": "Unbegrenzt"
}, },
"comment-page": { "comment-page": {
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
"a11y-select-time-1h": "Show all comments of the last hour", "a11y-select-time-1h": "Show all comments of the last hour",
"a11y-select-time-3h": "Show all comments of the last 3 hours", "a11y-select-time-3h": "Show all comments of the last 3 hours",
"a11y-select-time-1d": "Show all comments of the last day", "a11y-select-time-1d": "Show all comments of the last day",
"a11y-select-time-1w": "Show all comments of the last week", "a11y-select-time-1w": "Show all comments of the last 7 days",
"a11y-select-time-2w": "Show all comments of the last 14 days",
"a11y-select-time-all": "Show all comments", "a11y-select-time-all": "Show all comments",
"answered": "Answered questions", "answered": "Answered questions",
"add-comment": "Ask a question or write a message to the audience.", "add-comment": "Ask a question or write a message to the audience.",
...@@ -60,6 +61,7 @@ ...@@ -60,6 +61,7 @@
"select-time-3h": "Last 2 hours", "select-time-3h": "Last 2 hours",
"select-time-1d": "Last 24 hours", "select-time-1d": "Last 24 hours",
"select-time-1w": "Last 7 days", "select-time-1w": "Last 7 days",
"select-time-2w": "Last 14 days",
"select-time-all": "Unlimited" "select-time-all": "Unlimited"
}, },
"comment-page": { "comment-page": {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"a11y-select-time-3h": "Zeige alle Kommentare der letzten 3 Stunden an", "a11y-select-time-3h": "Zeige alle Kommentare der letzten 3 Stunden an",
"a11y-select-time-1d": "Zeige alle Kommentare der letzten 24 Stunden an", "a11y-select-time-1d": "Zeige alle Kommentare der letzten 24 Stunden an",
"a11y-select-time-1w": "Zeige alle kommentare der letzten 7 Tage an", "a11y-select-time-1w": "Zeige alle kommentare der letzten 7 Tage an",
"a11y-select-time-2w": "Zeige alle kommentare der letzten 14 Tage an",
"a11y-select-time-all": "Zeige alle Kommentare an", "a11y-select-time-all": "Zeige alle Kommentare an",
"answered": "Beantwortete Fragen", "answered": "Beantwortete Fragen",
"add-comment": "Stell deine Frage!", "add-comment": "Stell deine Frage!",
...@@ -60,6 +61,7 @@ ...@@ -60,6 +61,7 @@
"select-time-3h": "Letzte 2 Stunden", "select-time-3h": "Letzte 2 Stunden",
"select-time-1d": "Letzte 24 Stunden", "select-time-1d": "Letzte 24 Stunden",
"select-time-1w": "Letzte 7 Tage", "select-time-1w": "Letzte 7 Tage",
"select-time-2w": "Letzte 14 Tage",
"select-time-all": "Unbegrenzt" "select-time-all": "Unbegrenzt"
}, },
"content": { "content": {
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
"a11y-select-time-1h": "Show all comments of the last hour", "a11y-select-time-1h": "Show all comments of the last hour",
"a11y-select-time-3h": "Show all comments of the last 3 hours", "a11y-select-time-3h": "Show all comments of the last 3 hours",
"a11y-select-time-1d": "Show all comments of the last day", "a11y-select-time-1d": "Show all comments of the last day",
"a11y-select-time-1w": "Show all comments of the last week", "a11y-select-time-1w": "Show all comments of the last 7 days",
"a11y-select-time-2w": "Show all comments of the last 14 days",
"a11y-select-time-all": "Show all comments", "a11y-select-time-all": "Show all comments",
"answered": "Answered questions", "answered": "Answered questions",
"add-comment": "Ask a question!", "add-comment": "Ask a question!",
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
"select-time-3h": "Last 2 hours", "select-time-3h": "Last 2 hours",
"select-time-1d": "Last 24 hours", "select-time-1d": "Last 24 hours",
"select-time-1w": "Last 7 days", "select-time-1w": "Last 7 days",
"select-time-2w": "Last 14 days",
"select-time-all": "Unlimited" "select-time-all": "Unlimited"
}, },
"content": { "content": {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment