Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-11-26 06:45:21

wangden
New Member
Registered: 2009-11-26
Posts: 2

zem_events_list adjusting timezone - getting date right

Hi I can’t work out how to get the event list to show the right events. I want it to show what’s happening today only.

this is the code i have in my form:

<div id=“today” class=“events_list”>
<fieldset> <legend>What’s on today</legend>

<txp:zem_event_list wraptag=“ul” class=“vcalendar” break=“li” breakclass=“vevent” date_from=“today” date_to=“tomorrow”>
<span class=“dtstart” title=”<txp:zem_event_date class=”“ wraptag=”“ format=”%G-%m-%d” />”><txp:zem_event_time wraptag=”“ format=”%I:%M %p” /></span> -
<a class=“summary” href=”<txp:chh_if_data><txp:zem_event_url type=“text” /><txp:else /><txp:zem_event_permlink /></txp:chh_if_data>”>
<txp:zem_event_name wraptag=”“ class=”“ /></a>
</txp:zem_event_list>

<p><a href=“http://nkt-kmc-australia.org/index.php?s=calendar”>Events Calendar</a></p>
</fieldset>
</div>

In Preferences i’ve set time to GMT+11 which is right for melbourne, australia.

however, it shows events from tomorrow on it :(

even if someone could give me the possible parameters for date_from and date_to that would help.

Offline

#2 2009-11-27 11:54:34

wangden
New Member
Registered: 2009-11-26
Posts: 2

Re: zem_events_list adjusting timezone - getting date right

Ok, I can be a bit more clear about my issue. The server is in New York (i think). I am in Melbourne. I have readjusted the code above to have date_from=“now” and date_to=“midnight” which gets the right range of events (i.e. from 12am to 11:59pm today). However, the time that it changes over is wrong. It doesn’t change over to the next day at midnight. It seems to change about 5pm. (So for instance at 3pm today it was still showing yesterdays events) I think that it is calculating off the server time. I’ve tried adjusting the timezone setting in the preferences but this doesn’t seem to make any difference. Can anyone help with this?

Last edited by wangden (2009-11-28 03:36:04)

Offline

Board footer

Powered by FluxBB