[EventCalendar] filter question

Alex Tingle alex at firetree.net
Mon Feb 9 03:14:25 UTC 2009


Hi David,

Hmm. EC uses WP's date_format option - you seem to want to change that value
depending upon the current language.

The best way would be to intercept the "pre_option_*" filter. It allows you to
 override the value of any option. So, here's my untested example...

  function davids_set_date($date_format)
  {
    // Obviously your code would be more complicated here...
    return 'j F Y';
  }

  add_filter('pre_option_date_format','davids_set_date');

Let me know if it works.

-Alex

--

David Garlitz wrote:
> Hi Alex (et al),
> 
> I am using ec3 3.2beta2 on a bilingual site in conjunction with a plugin
> called Language Switcher. I've created a filter based on the filter that
> Lang Switcher uses for "the_date" to reformat the dates in
> "ec3_get_schedule" according to the user's language.
> 
> The thing is, the filter works correctly when I query the events using
> this line :
> 
> <?php $event_query = new WP_Query('showposts=2&ec3_after=today');
>   while ($event_query->have_posts()) :?>
> ....
> 
> <?php echo apply_filters('ec3_get_schedule','DGlang_ec3_date',
> ec3_get_schedule('%s ','%1$s %3$s %2$s. ','%s ')); ?>
> 
> But in the normal loop, or on queries using "$query_string," it
> "filters" the date but doesn't get the event's date - showing "Dec. 31
> 1969" as the event date.
> 
> Here's a link to a page where it works : http://test.davidgarlitz.com
> (see under the heading "Gigs :")
> Here's a link to a single post page where it doesn't work :
> http://test.davidgarlitz.com/279
> 
> Any ideas why this might be happening? Any suggestions on a more
> effective way to change the date output of ec3_get_schedule?
> Let me know if you need to see more code or other info, etc...
> 
> Dave
> 
> PS A related and possibly less complicated question : is there a way to
> output the date of an event and directly specify the date format (i.e.
> "ec3_the_schedule('j F Y');")?
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar


-- 
:: Let me solve your problems: http://www.firetree.net/alex/
:: alex.tingle AT firetree.net  +44-7901-552763

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://penguin.firetree.net/pipermail/eventcalendar/attachments/20090209/ba942ecd/signature.pgp


More information about the EventCalendar mailing list