The /admin/settings/date-time/formats and /admin/settings/date-time/formats/custom pages do not anymore correctly display our custom Japanese date formats although nothing has changed in DB table date_formats.

It went from (version 2.8):
Custom formats:

2012年05月21            remove  (configured as medium format)
2012年05月21日(Mon)     remove  (configured as long format)
05/21 - 13:30          remove

to (version 2.9):
Custom formats:

2012年05�	remove  (bad display, truncated?)
2012年05月21	remove  (bad display, truncated?)
05/21 - 13:37	remove

In table date_formats we have without a change between version 2.8 and 2.9:
Y年m月d日(D)
Y年m月d日
m/d - H:i
It should be possible to reproduce the error by simply copying above formats into the add formats screen.

On the /admin/settings/date-time/formats (configure) page
the long date format:
was displayed as "2012年05月21日(Mon)" but now shows as "2012年05月21" .
The medium date format:
was displayed as "2012年05月21日" but now shows as blank, empty.

It does not seem to affect the actual date formats as displayed on the users' content pages and the users' calendar pages though. The problem seems to be limited only to the display on the above mentioned admin pages.

The problem seems to be in the date_api.module around line 738. In function date_format_date() I changed:


function date_format_date() {
    ....
    $max = drupal_strlen($format);
    back to
   $max = strlen($format); 
    ....
}

as it was in version 2.8 and the display on the admin pages is OK ie not truncated anymore.

I do not really know about the root cause of the problem, drupal_strlen() seems to be confused with the Japanese characters in the custom date format string.

Comments

chaloalvarezj’s picture

I can confirm this as a bug! Don't want to change the module by my self but the solution here seems correct.

damienmckenna’s picture

Status: Active » Closed (won't fix)

Unfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.