Closed (duplicate)
Project:
Date
Version:
7.x-2.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 May 2012 at 23:03 UTC
Updated:
31 May 2012 at 12:29 UTC
Date format using special character like "j•m•y ▶ G:i" get render "two times" and look like that: "26•05•12 ▶ 2:00 •• ▶"
Note than format_date using the format doesn't have this issue.
With a date field that does *not* collect end date.
I try to render the field using a custom format like "d-m h:m ". I select the format in the node type field display settings (but the same occur in view...)
The result is going to be "29-10 12:34- :". The "- :" at the end make me think Date module try to render an empty date.
Comments
Comment #1
gagarine commentedrewrite the title... was late..
Comment #2
gagarine commentedIn the description I said it was "d-m h:m" thinking it will be simpler to get the issue. But in fact my format is "j•m•y ▶ G:i" and like scotself pointed me on IRC *this* is the problem.
Comment #2.0
gagarine commentedthe issues was about special characters
Comment #3
gagarine commentedThe problem is in the date_limit_format() when called by date_format_date() function.
We have regex like that
Than only remove \-/\.,: characters...
Comment #4
gagarine commentedWhat we can perhaps do is
- first find first all charter than are not part of date format http://www.php.net/manual/en/function.date.php (careful with escaped one...).
- use those caracter in the regex
Or give an option to avoid date_limit_format for custom format. Because you can create format than match your date granularity.
Comment #5
gagarine commentedSimilar issue #1538420: Custom characters intended as separators within custom formatted date/time are not displayed in the correct location.
Comment #5.0
gagarine commentedformat_date is ok