Skip to content

Commit

Permalink
Added date/time selector to CSV export/import
Browse files Browse the repository at this point in the history
  • Loading branch information
r3-gabriel committed Nov 5, 2023
1 parent 05797a1 commit c7a668e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 35 deletions.
24 changes: 19 additions & 5 deletions www/comps/listCsv.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,24 @@ let MyListCsv = {
<div class="list-csv-line" v-if="hasDate">
<span>{{ capApp.csvDate }}</span>
<input disabled="disabled" :value="settings.dateFormat" />
<select v-model="dateFormat">
<option value="Y-m-d">{{ capGen.dateFormat0 }}</option>
<option value="Y/m/d">{{ capGen.dateFormat1 }}</option>
<option value="d.m.Y">{{ capGen.dateFormat2 }}</option>
<option value="d/m/Y">{{ capGen.dateFormat3 }}</option>
<option value="m/d/Y">{{ capGen.dateFormat4 }}</option>
</select>
</div>
<div class="list-csv-line" v-if="hasDatetime">
<span>{{ capApp.csvDatetime }}</span>
<input disabled="disabled" :value="settings.dateFormat + ' ' + capApp.csvTimeHint" />
<select v-model="dateFormat">
<option value="Y-m-d">{{ capGen.dateFormat0 + ' ' + capApp.csvTimeHint }}</option>
<option value="Y/m/d">{{ capGen.dateFormat1 + ' ' + capApp.csvTimeHint }}</option>
<option value="d.m.Y">{{ capGen.dateFormat2 + ' ' + capApp.csvTimeHint }}</option>
<option value="d/m/Y">{{ capGen.dateFormat3 + ' ' + capApp.csvTimeHint }}</option>
<option value="m/d/Y">{{ capGen.dateFormat4 + ' ' + capApp.csvTimeHint }}</option>
</select>
</div>
<div class="list-csv-line" v-if="hasDatetime">
Expand Down Expand Up @@ -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,
Expand All @@ -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];
Expand All @@ -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'}`,
Expand Down Expand Up @@ -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');
Expand Down
10 changes: 5 additions & 5 deletions www/comps/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -942,11 +942,11 @@ let MySettings = {
<td>{{ capApp.dateFormat }}</td>
<td>
<select v-model="settingsInput.dateFormat">
<option value="Y-m-d">{{ capApp.dateFormat0 }}</option>
<option value="Y/m/d">{{ capApp.dateFormat1 }}</option>
<option value="d.m.Y">{{ capApp.dateFormat2 }}</option>
<option value="d/m/Y">{{ capApp.dateFormat3 }}</option>
<option value="m/d/Y">{{ capApp.dateFormat4 }}</option>
<option value="Y-m-d">{{ capGen.dateFormat0 }}</option>
<option value="Y/m/d">{{ capGen.dateFormat1 }}</option>
<option value="d.m.Y">{{ capGen.dateFormat2 }}</option>
<option value="d/m/Y">{{ capGen.dateFormat3 }}</option>
<option value="m/d/Y">{{ capGen.dateFormat4 }}</option>
</select>
</td>
</tr>
Expand Down
10 changes: 5 additions & 5 deletions www/langs/REPLACE_BY_BUILD/de_de
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions www/langs/REPLACE_BY_BUILD/en_us
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions www/langs/REPLACE_BY_BUILD/hu_hu
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions www/langs/REPLACE_BY_BUILD/it_it
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions www/langs/REPLACE_BY_BUILD/ro_ro
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit c7a668e

Please sign in to comment.