Commit c17d02e4 by Daniel Lee

csv: remove sep metadata as only works for excel

parent ee0d0155
...@@ -8,7 +8,7 @@ declare var window: any; ...@@ -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 ...@@ -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 ...@@ -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) + ';';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment