csv: remove sep metadata as only works for excel

This commit is contained in:
Daniel Lee 2017-05-26 15:41:50 +02:00
parent ee0d0155a5
commit c17d02e496

View File

@ -8,7 +8,7 @@ declare var window: any;
const DEFAULT_DATETIME_FORMAT: String = 'YYYY-MM-DDTHH:mm:ssZ'; const DEFAULT_DATETIME_FORMAT: String = 'YYYY-MM-DDTHH:mm:ssZ';
export function exportSeriesListToCsv(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT) { export function exportSeriesListToCsv(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT) {
var text = 'sep=;\nSeries;Time;Value\n'; var text = 'Series;Time;Value\n';
_.each(seriesList, function(series) { _.each(seriesList, function(series) {
_.each(series.datapoints, function(dp) { _.each(series.datapoints, function(dp) {
text += series.alias + ';' + moment(dp[1]).format(dateTimeFormat) + ';' + dp[0] + '\n'; text += series.alias + ';' + moment(dp[1]).format(dateTimeFormat) + ';' + dp[0] + '\n';
@ -18,7 +18,7 @@ export function exportSeriesListToCsv(seriesList, dateTimeFormat = DEFAULT_DATET
} }
export function exportSeriesListToCsvColumns(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT) { export function exportSeriesListToCsvColumns(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT) {
var text = 'sep=;\nTime;'; var text = 'Time;';
// add header // add header
_.each(seriesList, function(series) { _.each(seriesList, function(series) {
text += series.alias + ';'; text += series.alias + ';';
@ -53,7 +53,7 @@ export function exportSeriesListToCsvColumns(seriesList, dateTimeFormat = DEFAUL
} }
export function exportTableDataToCsv(table) { export function exportTableDataToCsv(table) {
var text = 'sep=;\n'; var text = '';
// add header // add header
_.each(table.columns, function(column) { _.each(table.columns, function(column) {
text += (column.title || column.text) + ';'; text += (column.title || column.text) + ';';