date_t function don't work with abbr translations. For example, when calling date_t('Apr', 'month_abbr', 'en'), the returned string is ''.
This is because array $untranslated don't have the right keys.
A possible fix for month_abbr could be :
case 'month_abbr':
$untranslated = array_flip(array_map('_date_substr_3', date_month_names_untranslated()));
break;
case 'month_name':
$untranslated = array_flip(date_month_names_untranslated());
break;
This code need to add a new function :
function _date_substr_3($string) {
return substr($string, 0, 3);
}
Comments
Comment #1
anonI created a patch for this based on B-Prod's solution.
Comment #2
anonThis error still occur in 6.x-2.4
Comment #3
anonforgott to change version. Sorry
Comment #4
damienmckennaUnfortunately 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.