CSV export: store duration/effort as minutes

This commit is contained in:
Helmut Merz 2016-03-29 18:17:44 +02:00
parent 608b75f1c8
commit 5b2b28da19
2 changed files with 2 additions and 1 deletions

View file

@ -248,7 +248,7 @@ Export of work data
>>> output = reportView()
>>> print output
Day;Start;End;Task;Party;Title;LA;Effort;State
08/12/28;19:00;20:15;loops Development;john;;;0.2500;finished
08/12/28;19:00;20:15;loops Development;john;;;15;finished
Meeting Minutes

View file

@ -85,6 +85,7 @@ class DurationField(Field):
def getExportValue(self, row, format, lang):
value = self.getValue(row)
if format == 'csv':
return '%i' % round(value * 60)
locale = locales.getLocale(lang)
fmt = locale.numbers.getFormatter('decimal')
return fmt.format(value, pattern=u'0.0000;-0.0000')