From c7a668ed4d48db2775d3d741e70343a4df90e5fc Mon Sep 17 00:00:00 2001 From: Gabriel Herbert Date: Sun, 5 Nov 2023 22:53:36 +0100 Subject: [PATCH] Added date/time selector to CSV export/import --- www/comps/listCsv.js | 24 +++++++++++++++++++----- www/comps/settings.js | 10 +++++----- www/langs/REPLACE_BY_BUILD/de_de | 10 +++++----- www/langs/REPLACE_BY_BUILD/en_us | 10 +++++----- www/langs/REPLACE_BY_BUILD/hu_hu | 10 +++++----- www/langs/REPLACE_BY_BUILD/it_it | 10 +++++----- www/langs/REPLACE_BY_BUILD/ro_ro | 10 +++++----- 7 files changed, 49 insertions(+), 35 deletions(-) diff --git a/www/comps/listCsv.js b/www/comps/listCsv.js index af240e84..f84c453e 100644 --- a/www/comps/listCsv.js +++ b/www/comps/listCsv.js @@ -37,12 +37,24 @@ let MyListCsv = {
{{ capApp.csvDate }} - +
{{ capApp.csvDatetime }} - +
@@ -111,6 +123,7 @@ let MyListCsv = { cacheDenialTimeout:null, // timer do refresh cache denial timestamp cacheDenialTimestamp:0, // unix timestamp, used for CSV export cache denial commaChar:',', + dateFormat:'Y-m-d', file:null, hasBool:false, hasDate:false, @@ -123,7 +136,8 @@ let MyListCsv = { }; }, mounted() { - this.action = this.isExport ? 'export' : 'import'; + this.action = this.isExport ? 'export' : 'import'; + this.dateFormat = this.settings.dateFormat; for(let i = 0, j = this.columns.length; i < j; i++) { let atr = this.attributeIdMap[this.columns[i].attributeId]; @@ -144,7 +158,7 @@ let MyListCsv = { `bool_false=${s.boolNative ? 'false' : s.capGen.option.no}`, `bool_true=${s.boolNative ? 'true' : s.capGen.option.yes}`, `comma_char=${encodeURIComponent(s.commaChar)}`, - `date_format=${encodeURIComponent(s.settings.dateFormat)}`, + `date_format=${encodeURIComponent(s.dateFormat)}`, `timezone=${encodeURIComponent(s.timezone)}`, `language_code=${s.settings.languageCode}`, `ignore_header=${s.hasHeader ? 'false' : 'true'}`, @@ -208,7 +222,7 @@ let MyListCsv = { formData.append('joins',JSON.stringify(this.query.joins)); formData.append('lookups',JSON.stringify(this.query.lookups)); formData.append('boolTrue',this.boolNative ? 'true' : this.capGen.option.yes); - formData.append('dateFormat',this.settings.dateFormat); + formData.append('dateFormat',this.dateFormat); formData.append('timezone',this.timezone); formData.append('commaChar',this.commaChar); formData.append('ignoreHeader',this.hasHeader ? 'true' : 'false'); diff --git a/www/comps/settings.js b/www/comps/settings.js index c02f6f6f..248d0653 100644 --- a/www/comps/settings.js +++ b/www/comps/settings.js @@ -942,11 +942,11 @@ let MySettings = { {{ capApp.dateFormat }} diff --git a/www/langs/REPLACE_BY_BUILD/de_de b/www/langs/REPLACE_BY_BUILD/de_de index 974f7fc9..c0f4731c 100644 --- a/www/langs/REPLACE_BY_BUILD/de_de +++ b/www/langs/REPLACE_BY_BUILD/de_de @@ -91,6 +91,11 @@ "content":"Inhalt", "contextHelp":"Kontexthilfe", "date":"Datum", + "dateFormat0":"Y-m-d (2012-12-30)", + "dateFormat1":"Y/m/d (2012/12/30)", + "dateFormat2":"d.m.Y (30.12.2012)", + "dateFormat3":"d/m/Y (30/12/2012)", + "dateFormat4":"m/d/Y (12/30/2012)", "description":"Beschreibung", "details":"Details", "displayed":"Angezeigt", @@ -1913,11 +1918,6 @@ "bordersCorners":"Rahmenecken", "compact":"Kompaktes Layout", "dateFormat":"Datumsformat", - "dateFormat0":"Y-m-d (2012-12-30)", - "dateFormat1":"Y/m/d (2012/12/30)", - "dateFormat2":"d.m.Y (30.12.2012)", - "dateFormat3":"d/m/Y (30/12/2012)", - "dateFormat4":"m/d/Y (12/30/2012)", "dark":"Dunkle Ansicht", "fieldClean":"Feldhintergründe", "fontFamily":"Schriftart", diff --git a/www/langs/REPLACE_BY_BUILD/en_us b/www/langs/REPLACE_BY_BUILD/en_us index 72ab0dbe..160ba284 100644 --- a/www/langs/REPLACE_BY_BUILD/en_us +++ b/www/langs/REPLACE_BY_BUILD/en_us @@ -91,6 +91,11 @@ "content":"Content", "contextHelp":"Context help", "date":"Date", + "dateFormat0":"Y-m-d (2012-12-30)", + "dateFormat1":"Y/m/d (2012/12/30)", + "dateFormat2":"d.m.Y (30.12.2012)", + "dateFormat3":"d/m/Y (30/12/2012)", + "dateFormat4":"m/d/Y (12/30/2012)", "description":"Description", "details":"Details", "displayed":"Displayed", @@ -1913,11 +1918,6 @@ "bordersCorners":"Border corners", "compact":"Compact layout", "dateFormat":"Date format", - "dateFormat0":"Y-m-d (2012-12-30)", - "dateFormat1":"Y/m/d (2012/12/30)", - "dateFormat2":"d.m.Y (30.12.2012)", - "dateFormat3":"d/m/Y (30/12/2012)", - "dateFormat4":"m/d/Y (12/30/2012)", "dark":"Dark mode", "fieldClean":"Field backgrounds", "fontFamily":"Font", diff --git a/www/langs/REPLACE_BY_BUILD/hu_hu b/www/langs/REPLACE_BY_BUILD/hu_hu index b4be132b..a2bc6ffc 100644 --- a/www/langs/REPLACE_BY_BUILD/hu_hu +++ b/www/langs/REPLACE_BY_BUILD/hu_hu @@ -91,6 +91,11 @@ "content":"Tartalom", "contextHelp":"Kontextussegítség", "date":"Dátum", + "dateFormat0":"É-h-n (2012-12-30)", + "dateFormat1":"É/h/n (2012/12/30)", + "dateFormat2":"n.h.É (30.12.2012)", + "dateFormat3":"n/h/É (30/12/2012)", + "dateFormat4":"h/n/É (12/30/2012)", "description":"Leírás", "details":"Részletek", "displayed":"Megjelenített", @@ -1913,11 +1918,6 @@ "bordersCorners":"Sarokkeretek", "compact":"Kompakt elrendezés", "dateFormat":"Dátumformátum", - "dateFormat0":"É-h-n (2012-12-30)", - "dateFormat1":"É/h/n (2012/12/30)", - "dateFormat2":"n.h.É (30.12.2012)", - "dateFormat3":"n/h/É (30/12/2012)", - "dateFormat4":"h/n/É (12/30/2012)", "dark":"Sötét nézet", "fieldClean":"Mező háttér", "fontFamily":"Betűtípus", diff --git a/www/langs/REPLACE_BY_BUILD/it_it b/www/langs/REPLACE_BY_BUILD/it_it index f185c6b8..d94ac3d2 100644 --- a/www/langs/REPLACE_BY_BUILD/it_it +++ b/www/langs/REPLACE_BY_BUILD/it_it @@ -91,6 +91,11 @@ "content":"Content", "contextHelp":"Context help", "date":"Data", + "dateFormat0":"Y-m-d (2012-12-30)", + "dateFormat1":"Y/m/d (2012/12/30)", + "dateFormat2":"d.m.Y (30.12.2012)", + "dateFormat3":"d/m/Y (30/12/2012)", + "dateFormat4":"m/d/Y (12/30/2012)", "description":"Descrizione", "details":"Details", "displayed":"Displayed", @@ -1913,11 +1918,6 @@ "bordersCorners":"Angoli del bordo", "compact":"Layout compatto", "dateFormat":"Formato Data", - "dateFormat0":"Y-m-d (2012-12-30)", - "dateFormat1":"Y/m/d (2012/12/30)", - "dateFormat2":"d.m.Y (30.12.2012)", - "dateFormat3":"d/m/Y (30/12/2012)", - "dateFormat4":"m/d/Y (12/30/2012)", "dark":"Modalità scura", "fieldClean":"Field backgrounds", "fontFamily":"Font", diff --git a/www/langs/REPLACE_BY_BUILD/ro_ro b/www/langs/REPLACE_BY_BUILD/ro_ro index 48360639..820d6a96 100644 --- a/www/langs/REPLACE_BY_BUILD/ro_ro +++ b/www/langs/REPLACE_BY_BUILD/ro_ro @@ -91,6 +91,11 @@ "content":"Content", "contextHelp":"Context help", "date":"Data", + "dateFormat0":"aaaa-ll-zz (2012-12-30)", + "dateFormat1":"aaaa/ll/zzz (2012/12/30)", + "dateFormat2":"zz.ll.aaaa (30.12.2012)", + "dateFormat3":"aaaa/ll/zz (30/12/2012)", + "dateFormat4":"ll/zz/aa (12/30/2012)", "description":"Descriere", "details":"Details", "displayed":"Displayed", @@ -1913,11 +1918,6 @@ "bordersCorners":"Colțuri la margine", "compact":"Aspect compact", "dateFormat":"Formatul datei", - "dateFormat0":"aaaa-ll-zz (2012-12-30)", - "dateFormat1":"aaaa/ll/zzz (2012/12/30)", - "dateFormat2":"zz.ll.aaaa (30.12.2012)", - "dateFormat3":"aaaa/ll/zz (30/12/2012)", - "dateFormat4":"ll/zz/aa (12/30/2012)", "dark":"Mod întunecat", "fieldClean":"Field backgrounds", "fontFamily":"Font",