Here's my date format:

n.j.Y<b\r /><\e\m>g:ia</\e\m>

Works fine when viewing a full node, however in a view field (list view) this is the output:

4.21.2008<br>&<\04&>12:00pm<!--\04-->

That's clearly not what I intended. LOL

CommentFileSizeAuthor
#2 date_api.module.patch1.2 KBseanr
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

seanr’s picture

Title: Custom format in views not handling some escaped characters correctly » regexp in date_limit_format strips escaped characters from custom formats

Figured it out. The problem, is the regexp in date_limit_format (date_api.module:1105) is stripping out all O's Z's P's and e's, regardless of whether they've been escaped or not (all s's simillarly get stripped by 1133). So basically, I need help fixing this regexp to only strip out the letters when not preceded by a \:

'([OZPe])'

seanr’s picture

Component: Code » Date API
Status: Active » Needs review
FileSize
1.2 KB

Here's a patch thanks to IslandUsurper's kind assistance and superior knowledge of regexps. ;-)

KarenS’s picture

Status: Needs review » Fixed

Just committed this as a part of a bigger project to clean up the way that regex was working. I meant to give credit to IslandUsurper and seanr, but got in too much of a hurry and didn't. Sorry about that, but thanks for the fix. (And sorry it took so long to get to this, it was just less critical than other things I was working on).

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.