Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-5987

Import custom data date fields only works in American (core fields import fine)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1.3
    • Fix Version/s: 3.4.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When you try to import contacts (for example) and have core and custom data date fields and select a date format for the import other than 'American' (mm-dd-yyyy) the core fields import fine but the custom data ones don't

      It doesn't work even if your csv matches the format you have set your custom field to (although I don't think this should be relevant as you are describing the format of the csv not the civicrm field.

      I have started trying to make sense of the code to see if I could patch it but got bewildered when I hit this piece of code: (import/parser/contact approx line 1641) since it seems to use a bunch of conditionals but do the same thing whatever the answer

      if ( $dateType == 1 ) {
      if ( strstr( $params[$dateParam], '-' ) )

      { $formatted[$dateParam] = CRM_Utils_Date::processDate( $params[$dateParam] ); }

      else

      { $formatted[$dateParam] = CRM_Utils_Date::processDate( $params[$dateParam] ); }

      } else

      { $formatted[$dateParam] = CRM_Utils_Date::processDate( $params[$dateParam] ); }

      Side issues with date format in non-American are that it allows dd-mm-yyyy but not dd-mm-yy and also that it says it treats mm-dd-yyyy, dd/mm/yyyy and ddmmyyyy the same but says only dd-mm-yyyy and dd/mm/yyyy are treated the same (i.e implies it doesn't accept ddmmyyyy - I haven't managed to test this yet as my import is stalled on the above.

        Attachments

          Activity

            People

            • Assignee:
              neha.saraph Neha Kulkarni
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: