The current date range separator for fields that collect both a start and end date is a hyphen. This can be a bit confusing and unclear in some situations (especially in cases where times are being displayed, since a hyphen is also used to separate the date from the time).
Jeff Noyes suggests changing it to the word 'to', which seems pretty reasonable to me since that's a pretty common way to refer to date ranges.
The attached patch makes that change in the default theme function. Any reason not to do that?
| Comment | File | Size | Author |
|---|---|---|---|
| date-separator-to.patch | 1.07 KB | David_Rothstein |
Comments
Comment #1
karens commentedOK by me. I see you also removed the css class for the separator. Don't know if any will care about that or not, but I guess we'll see. It's a new release cycle so it should be OK.
Comment #2
karens commentedArg, this broke a bunch of tests that were using AssertText(). Fixing that now.
Comment #3
David_Rothstein commentedOops, sorry about that. I'm too used to working in the core queue where the testbot automatically runs tests for me...
Comment #4
omercioglu commentedPlease put "date-display-separator" class back, perhaps like below:
Comment #5
David_Rothstein commentedI think that would cause problems for translators. (For example, in some languages, "to" isn't even its own word.)
With all the other classes in this area of the code, I think most simple theming needs can already be met, can't they? (For example, theme the parent item the way you want "to" to appear and then theme the other parts to undo that.)
For more complex needs, you can always override theme_date_display_range() entirely and add whatever classes you want. One thing that might be worth doing here (to help make that simpler) is to move all the RDF-related code out of that theme function and into a preprocess function. It probably belongs in the preprocess layer anyway, and that way the theme function itself would be a lot simpler (just HTML) and therefore cleaner to override.
Comment #6
David_Rothstein commentedI just wrote a patch for that here: #1253248: Move RDF-related code to theme preprocess functions, to make the theme functions easier to override
I think this issue should probably be closed, since if there are any further followups they could be done elsewhere.
Comment #7
karens commentedI can see the potential benefit of a separator class, and we've had one in the past. The way it was proposed in #4 would probably be a translation problem, but I think it could be done like this and not be too difficult to translate (since we keep the context):
Comment #8
David_Rothstein commentedYeah, I guess that would work. It's a bit unfortunate to have that much HTML in a translatable string, but I agree it wouldn't break anything.
Comment #9
karens commentedWell, let's keep it clean and leave it out. Someone who wants the wrapper can override the theme and add it. If you're doing anything with the separator you are probably already doing some custom theming, so that shouldn't be an enormous burden.
Comment #11
cristian100Ohh man, In my case I really need it to be a hyphen, why don't have a feature to customize the character here?? at timefield module I really love that I can type the separator of times ranges.
Comment #12
HeathN commentedWe need to make this more dynamic. Purposed change here 'https://drupal.org/node/2237843'.