Skip to content

Commit

Permalink
feat(csv_export): Local timezone export option
Browse files Browse the repository at this point in the history
  • Loading branch information
reinzor committed Apr 12, 2021
1 parent 71d9aaf commit 15b71ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export default {
csvItems() {
return this.data.items.map(item => {
let csvItem = Object.assign({}, item)
if (globalOptions.csvExportDatesInLocalTimezone) {
csvItem.timeBegin = moment(item.timeBegin).format('YYYY-MM-DDTHH:mm:ss.SSS')
csvItem.timeEnd = moment(item.timeEnd).format('YYYY-MM-HH:mm:ss.SSS')
}
if (globalOptions.csvExportProcessedDistance) {
csvItem.distance = this.$options.filters.distance(item.distance, 2, true)
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/GlobalOptionsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
<b-badge variant="secondary">seconds</b-badge><small class="text-muted"> vs </small
><b-badge variant="primary">hh:mm:ss</b-badge>
</b-form-checkbox>
<label for="csv-export-local-timezone" class="mt-2">Export dates in local timezone:</label>
<b-form-checkbox
id="csv-export-local-timezone"
v-model="globalOptions.csvExportDatesInLocalTimezone"
name="check-button"
switch
>
</b-form-checkbox>
</b-tab>
</b-tabs>
</b-modal>
Expand Down
1 change: 1 addition & 0 deletions src/services/global_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Globaloptions {

this.csvExportProcessedDistance = false
this.csvExportProcessedDuration = false
this.csvExportDatesInLocalTimezone = false

this.load()
}
Expand Down

0 comments on commit 15b71ee

Please sign in to comment.