Browse Source

refactor(AdvancedTable): set datetime input value to now by default

Kristian Vos 2 years ago
parent
commit
c2bcddea81
1 changed files with 8 additions and 1 deletions
  1. 8 1
      frontend/src/components/AdvancedTable.vue

+ 8 - 1
frontend/src/components/AdvancedTable.vue

@@ -1609,8 +1609,15 @@ export default {
 			this.highlightRow(newItemIndex);
 		},
 		addFilterItem() {
+			let data = "";
+			if (this.addFilterValue.defaultFilterType.startsWith("datetime")) {
+				const now = new Date();
+				now.setMinutes(now.getMinutes() - now.getTimezoneOffset());
+				data = now.toISOString().slice(0, 16);
+			}
+
 			this.editingFilters.push({
-				data: "",
+				data,
 				filter: this.addFilterValue,
 				filterType:
 					this.allFilterTypes[this.addFilterValue.defaultFilterType]