Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • CiviCRM Core CiviCRM Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,460
    • Issues 1,460
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • CiviCRM CoreCiviCRM Core
  • Issues
  • #2504
Closed
Open
Created Apr 01, 2021 by jaapjansma@jaapjansmaDeveloper

CiviReport does not localize custom date fields when exporting to CSV

CiviReport does not localize custom fields of type Date

How to reproduce

  1. Set localization settings: Date Format Complete date to %d-%m-%Y
  2. Add a custom group for cases
  3. Add a custom field of Type Date and no time.
  4. Enter a value such as 31-04-2021 (1st of april 2021)
  5. Create a new CiviCase detail report. Check the column to display the custom field.
  6. Export the report to CSV

Expected result

Value of the custom field displayed as 01-04-2021 as it is shown in the report and according to the localization setting.

Actual result

Value of custom field is displayed as 2021-04-01 which is ISO format.

Comment

The format for iso format is hard coded in: https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php#L270

I am not sure if that is the desired behavior. I dont think so as the custom fields of type money are localized into a CSV export. So I would argue that the date should also be formatted according to the localization settings.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking