Comments

japerry’s picture

Assigned: Unassigned » japerry
ezra-g’s picture

Priority: Normal » Major
japerry’s picture

Status: Active » Needs review
StatusFileSize
new7.17 KB

Here is my first big whack at it... features

it overrides the theme registry and inserts some fun regular expressions to format the date more beautifully. I should only work on those date formats that fit the regular expressions below. I did a bit of testing on different expressions, and does work out of the box and with 12/24 hour formats.

japerry’s picture

ezra-g’s picture

Status: Fixed » Needs work
StatusFileSize
new14.41 KB

The "upcoming events" block looks busted per this screenshot.

ezra-g’s picture

Priority: Major » Critical
japerry’s picture

Status: Needs work » Fixed

Fixed by changing the long formatter to events_datetime in the view.

http://drupalcode.org/project/commons_events.git/commit/5e00bb6

hservaes9’s picture

Hello.

I have some events which have different begin - end dates.
For event with the same begin - end date, it's okay.

See attachment.

Thanks.

hservaes9’s picture

StatusFileSize
new22.09 KB

Hello.

I have some events which have different begin - end dates.
For event with the same begin - end date, it's okay.

See http://postimg.org/image/6l49p20nb/

Thanks.

japerry’s picture

Status: Fixed » Active

Make sure you ran updb after going to 3.1, it should set your view to use the event_datetime formatter, which will be correct.

Thanks for that update -- what date format are you using for your dates? You can find out by checking out admin/config/regional/date-time

You'll either have to inspect the page (view source) to see the actual format, or look at the database like this:

https://www.evernote.com/shard/s12/sh/b2ae6a4a-f2ec-4a91-8a60-ffd75979a2...

japerry’s picture

Assigned: japerry » Noyz
Status: Active » Needs review

Also, assigning this to Jeff to approve. Here are some potential designs we could use:

Same years; different months,days. we combine the dates together and the times together:
https://www.evernote.com/shard/s12/sh/13dfffe4-5ed8-448b-afdd-5972b5f196...

Same months, years; different days and times.
https://www.evernote.com/shard/s12/sh/d304339a-7a80-40ab-95d8-7d2b82a66a...

Same month , year, day: different time (note this uses the default formatter):
https://www.evernote.com/shard/s12/sh/96619bfc-ee53-4d80-b128-3298825004...

These are much simpler, in code, than the current design, and we can use this for php 5.2. But I still have the other design setup for 5.3

hservaes9’s picture

StatusFileSize
new30.3 KB
new32.28 KB
new18.69 KB
new167.71 KB
new147.16 KB

Hello,

Thanks, I ran updb after going to 3.1. The view event_datetime formatter seems correct.

I tried with your date format, same problem on the upcoming events view.

Same problem on the event page.

ezra-g’s picture

@japerry, can you post a patch that corresponds to the designs proposed in #11?

japerry’s picture

StatusFileSize
new7.83 KB

opps yah I got snagged on an issue friday afternoon. After the refreshing weekend, figured out the mistake ;-) heres the patch!

Some notes:
* Uses basically the original format outlined in the spec
* Uses the format above only when a) the range is > year or b) when using Mon, Tues, etc in a date
* Doesn't need regular expressions!

I think this is a much simpler solution, and shouldn't be as fragile.

ezra-g’s picture

This seems to be functioning well. Nice use of the Date API over regex!

One note:

commons_events_theme_date_display_range_simple($variables)

Any reason not to call theme() here? I don't see a code path to recursion that we're avoiding with the direct call.

ezra-g’s picture

Also, bumping radar to 3.2.

ezra-g’s picture

Status: Needs review » Needs work

Discussed with japerry in IRC. Marking as NW per #15.

japerry’s picture

Status: Needs work » Needs review
StatusFileSize
new10.69 KB
japerry’s picture

Assigned: Noyz » japerry
Status: Needs review » Fixed
tmcnamara98’s picture

Status: Fixed » Needs review

Hello,

are we sure this solves the issue? I just downloaded the most recent version and still get the preg_filter() error. I do have PHP version 5.2.

Tim

japerry’s picture

Status: Needs review » Fixed

the 3.2 release still contains code from 3.1. Sorry about that. When we release 3.3 it will have the updated code.

In the meantime, you should be save to use either the commons dev snapshot, or use 3.2 and manually update the commons_events module to its dev snapshot.

tmcnamara98’s picture

Thank you for the response.

How do I get this snapshot? I just downloaded 7.x-3.x-dev and it still has preg_filter() called on line 477 of commons_events.module.

-Tim

tmcnamara98’s picture

Please disregard comment #22; I got it. -Tim

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