← Back to team overview

magentoerpconnect-community team mailing list archive

Date attribute sync issues

 

Hello all,

I recently came across an issue with the connector syncing dates with
Magento. Posting here for future reference in case anyone else has a
related problem.

When a Magento product attribute 'date' field is used, Magento will
misinterpret the date passed from the OpenERP connector in certain
circumstances. The format passed from OpenERP is always the standard
YYYY-MM-DD as far as I can tell. Depending on the locale set in Magento
the DD and MM can be confused and set incorrectly in Magento.

For example, April 01, 2011 will be passed as '2011-04-01'. If the
locale in Magento is set to en_US, Magento will consider the date to be
January 04, 2011 which not correct. If the day is set to a number that
is not possible to assign to a month the date is handled correctly i.e.
'2011-03-30' for March 30, 2011.

In my case, I changed the locale setting in Magento to a European locale
and now dates sync correctly. A more permanent fix would probably
require updating Magento's handling of string to date conversion.

Regards,
Colm