1

I try to import a csv (or excel with feeds_xls) with a title-, date- and body field in Drupal 7. The date has a calendar widget

When imported the date is empty. I think because of the difference in notation:

English: Y/m/d H:i Belgian: d/m/Y H:i

My client has to be able to use the Belgian (EU) notation. He or she puts it in the .csv like this:

d/m/Y

for example: 19th of August 2016 becomes a string:

'16/8/2016'

I have tried the following steps: - dev-version of the feeds_tamper module - tried the feeds_tamper-str_to_time_with_custom_format_plugin-2631092-1.patch - tried the strtotime plugin of the feeds_tamper module - wrote a custom plugin that tries to convert the string - tried a text-widget

The closest I get is what I think is the original item:

array( 'TITEL' => 'Test', 'DATUM' => '41671', 'BESCHRIJVING' => 'test', )

that is the right date (DATUM). Can anyone shine a light on this for me?

7
  • Create a custom tamper plugin and do it like this: Convert date format yyyy-mm-dd => dd-mm-yyyy
    – No Sssweat
    Commented Aug 19, 2016 at 8:21
  • Thanks for responding. I have added the code. Watchdog seems fine, I get a timestamp <code>1455231600</code>. But the field of the node stays empty... . What did I forget? Commented Aug 19, 2016 at 9:16
  • you need to save it in the format your date field is on. Ex: Y/m/d
    – No Sssweat
    Commented Aug 19, 2016 at 9:23
  • Hi, the date field is Date (Unix) Commented Aug 19, 2016 at 10:25
  • 1
    NS, I don't know how but I got it working... . With a date-type Commented Aug 19, 2016 at 12:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.