In date_api/date_api.module there is the following Regex removing 'orphaned' dots from the end of date format definitions:
// Remove orphaned punctuation at the end of the string.
$format = preg_replace('([\-/\.,:\']$)', '', $format);
$format = preg_replace('(\\$)', '', $format);
When I define a date format like m.d. with hook_date_formats(), to get an output of 23.02., the trailing dot (after the 02) gets stripped out by the regex. The date get displayed as 23.02 (without the trailing dot).
Simply removing the code solves the problem (patch attached). Is this removal of trailing punctuation really necessary?
The attached patch is rather brutish but effective.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | trailing-punctuation-1452408-1.patch | 625 bytes | reglogge |
| trailing_punctuation.patch | 656 bytes | reglogge |
Comments
Comment #1
reglogge commentedOr, much more subtle, just removing the dot from the regex. Patch attached.
Comment #2
arlinsandbulte commentedApplied patch in #1:
http://drupalcode.org/project/date.git/commit/aee1624
Thanks.