Problem/Motivation

Hello,
I've a site in Catalan language. I can see events with the translated "date start" and "date end", but only when the difference between dates is different than "month".

Commons events shows event dates in different formats depending on the difference between start date and end date.
For example (in catalan language, cause is the example I have):

dilluns, 23 febrer, 2015 - 15:00 - 16:30
dilluns, 2 març, 2015 fins a dijous, 12 març, 2015, 17:00 - 22:00
divendres, 13 febrer fins a dissabte, 14 març, 2015, 09:15 - 09:15

All this logic is done in commons_events module, but it is not taking in account the language for some use cases.

Proposed resolution

Looks like theme_commons_events_date_display_range_advanced() is using format() function from date module, but format() function is not language aware.

I've attached a patch that uses date_format_date() and date_limit_format(), getting the same funcionallity but language aware.

If you can test it, it will be great.
thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TuWebO’s picture

Added same logic when the difference between dates are days and not only months.

TuWebO’s picture

Notice, the patch is made against the module commons_events folder, not the commons folder. If you need me to change this, please let me know.

mgifford’s picture

Issue tags: +i18n

I confirmed that I can apply this patch within commons-7.x-3.20/profiles/commons/modules/commons/commons_events

I haven't replicated the problem yet, but wanted to give a very basic review first. I'm not sure what's being done specifically for this module.

It's a pretty simple patch and moving to date_limit_format() makes sense to me.

TuWebO’s picture

Issue summary: View changes

@mgifford I've documented a little bit more the summary, thanks for the review.

TuWebO’s picture

Hi,
This patch is still aplicable, do you guys think that should be commited?