Use locale timezone to export CSV in locale format

Closes #12224
This commit is contained in:
Cédric Krier
2023-05-07 10:08:24 +02:00
parent dc3afbd016
commit ab8a993c85
4 changed files with 6 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Use locale timezone for CSV in locale format
Version 6.8.0 - 2023-05-01
--------------------------
+3 -1
View File
@@ -2250,7 +2250,7 @@
line.forEach(function(val, i) {
if (locale_format) {
if (val.isDateTime) {
val = val.format(
val = val.local().format(
Sao.common.date_format() + ' ' +
Sao.common.moment_format('%X'));
} else if (val.isDate) {
@@ -2265,6 +2265,8 @@
'maximumFractionDigits': 20,
});
}
} else if (val.isDateTime) {
val = val.utc();
} else if (val.isTimeDelta) {
val = val.asSeconds();
} else if (typeof(val) == 'boolean') {
+1
View File
@@ -1,3 +1,4 @@
* Use locale timezone for CSV in locale format
* Display sum on column header
Version 6.8.0 - 2023-05-01
+1
View File
@@ -433,6 +433,7 @@ class WinExport(WinCSV):
if isinstance(val, Number):
val = locale.str(val)
elif isinstance(val, datetime.datetime):
val = common.timezoned_date(val)
val = val.strftime(common.date_format() + ' %X')
elif isinstance(val, datetime.date):
val = val.strftime(common.date_format())