I am having a hard time importing single years from CSV file. I have verified my CSV file is correct, i.e. the year I'm trying to import is 2003.

I'm trying to import this to a node, and the field in my node of of type "Date" and the "customize input format" is set to Y.

However, whenever I import, all I get as a result is 2012.

Comments

David_Rothstein’s picture

Title: Importing a Single Year defaults to Current Year » Importing a single 21st century year defaults to the current year
Component: Feeds Import » Code
Status: Active » Needs review
StatusFileSize
new1011 bytes

I ran into this too, but discovered it only happens if the year is 2000 or later (!).

After a lot of searching, I came across http://aaronsaray.com/blog/2007/07/11/helpful-strtotime-reminders/#comme... which explains it. Crazy stuff!

The attached patch contains a simple fix.

twistor’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Issue summary: View changes
Status: Needs review » Patch (to be ported)

That is a fun one.

http://drupalcode.org/project/feeds.git/commit/2c05963

I added a test and removed the is_int() check for the timestamp.

twistor’s picture

Status: Patch (to be ported) » Closed (outdated)