Allow to search for past events

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-11-07 17:53:09 +01:00
parent a46372094c
commit f55ca90c35
4 changed files with 27 additions and 16 deletions

View File

@@ -1232,5 +1232,6 @@
"This profile is from another instance, the informations shown here may be incomplete.": "This profile is from another instance, the informations shown here may be incomplete.",
"View full profile": "View full profile",
"Any type": "Any type",
"In person": "In person"
"In person": "In person",
"In the past": "In the past"
}

View File

@@ -1336,5 +1336,6 @@
"This profile is from another instance, the informations shown here may be incomplete.": "Ce profil provient d'une autre instance, les informations montrées ici peuvent être incomplètes.",
"View full profile": "Voir le profil complet",
"Any type": "N'importe quel type",
"In person": "En personne"
"In person": "En personne",
"In the past": "Dans le passé"
}

View File

@@ -213,7 +213,7 @@ import debounce from "lodash/debounce";
interface ISearchTimeOption {
label: string;
start?: Date;
start?: Date | null;
end?: Date | null;
}
@@ -292,6 +292,11 @@ export default class Search extends Vue {
location: IAddress = new Address();
dateOptions: Record<string, ISearchTimeOption> = {
past: {
label: this.$t("In the past") as string,
start: null,
end: new Date(),
},
today: {
label: this.$t("Today") as string,
start: new Date(),
@@ -346,7 +351,7 @@ export default class Search extends Vue {
data(): Record<string, unknown> {
return {
debouncedUpdateSearchQuery: debounce(this.updateSearchQuery, 200),
debouncedUpdateSearchQuery: debounce(this.updateSearchQuery, 500),
};
}
@@ -525,7 +530,7 @@ export default class Search extends Vue {
}
};
get start(): Date | undefined {
get start(): Date | undefined | null {
if (this.dateOptions[this.when]) {
return this.dateOptions[this.when].start;
}