Project

General

Profile

Actions

Defect #35726

open

Time Formatting does not apply to CSV exports

Added by salman mp over 2 years ago. Updated 4 months ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Time tracking
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When you export time report to CSV, formatting does not apply on hours field.
Attached patch can fixed it.


Files

timelog_helper.patch (1.27 KB) timelog_helper.patch salman mp, 2021-08-09 18:25
#35726.patch (1.66 KB) #35726.patch Patch against trunk @ r21131 Mischa The Evil, 2021-08-09 21:33

Related issues

Related to Redmine - Feature #23996: Introduce a setting to change the display format of timespans to HH:MMClosedJean-Philippe Lang

Actions
Related to Redmine - Defect #31637: CSV and PDF export don't respect Time span formatConfirmed

Actions
Actions #1

Updated by Mischa The Evil over 2 years ago

  • File #35726.patch #35726.patch added
  • Subject changed from Time Formatting does not apply in time reports export to Time Formatting does not apply to CSV exports
  • Category deleted (Time tracking)
  • Status changed from New to Confirmed
  • Affected version changed from 4.2.2 to 3.4.0
Nice catch! However, this does not only apply to the CSV export of the timelog report. It also applies to CSV exports of:
  • timelog details;
  • issue lists.
I'll leave a patch containing:
  • the OP's initial changes, in a correct format;
  • an additional change of QueriesHelper#csv_value to fix the issue for CSV exports of timelog details and issue lists.

I'll set the category to 'none' because it applies not only to 'Time tracking' and we don't have a CSV export category yet (and I don't want [to consider] to create it now).
I'll set the affected version to '3.4.0' because the issue was introduced with #23996. The fixes have to be back-ported to all supported Redmine branches.

I think that before this is being committed additional test coverage should be added for the fixed cases.

Actions #2

Updated by Mischa The Evil over 2 years ago

  • Related to Feature #23996: Introduce a setting to change the display format of timespans to HH:MM added
Actions #3

Updated by Holger Just over 2 years ago

I don't think we should backport this to older versions.

The CSV export emits a technical format which is usually consumed by spreadsheet software, or custom reporting tools. ere, it is important not to change the output format without consideration. As the output of the hours have always been floats here, consuming software likely expects this. Changing this in a patch update will likely break the assumptions of these tools unexpectedly.

As such, I believe we may ship this in 5.0.0 as a potentially breaking change and not backport it.

Actions #4

Updated by Mischa The Evil over 2 years ago

Good point. Fair enough. FYI, I'm also ok with no back-ports like you propose. My comment was more about the Redmine releases that are affected by this defect, and as such can be qualified as eligible for receiving the back-ports.

Nonetheless, I don't think that back-porting the fixes would become troublesome for the users in this case because:

Holger Just wrote:

[...] As the output of the hours have always been floats here, consuming software likely expects this. Changing this in a patch update will likely break the assumptions of these tools unexpectedly.

... this is not what these fixes would actually do IMHO. They don't change the output format of hours. Instead, slightly more subtle, they change the applicability of the setting that should determine the desired output format of the hours values.
Now, given that the default value of the setting is (still) to output floats (i.e. 'decimal'), nothing would change unless the administrator itself explicitly configured the Redmine instance to do so (i.e. by changing the setting to 'minutes'). And in that case it is/would be an anomaly to detect that only the CSV exports don't obey this setting (given that #23996 states: "a setting to also display such values in this way throughout the app"). And by then we can "argue" over whether "throughout the app" actually applies to CSV exports created by 'the app'... :lol: I'd say it does... :grin:

Actions #5

Updated by Go MAEDA about 2 years ago

  • Related to Defect #31637: CSV and PDF export don't respect Time span format added
Actions #6

Updated by Go MAEDA about 2 years ago

  • Category set to Time tracking
Actions #7

Updated by Mischa The Evil 4 months ago

  • Target version set to 6.0.0

This might be the time to schedule this (and by extension #31637).

Actions

Also available in: Atom PDF