[Typo3] Extended Calendar Showing Wrong Dates

Christopher bedlamhotel at gmail.com
Wed Aug 17 06:52:49 CEST 2005


Hi,


On 16/08/05, Martin S <shieldfire at gmail.com> wrote:
> >
> >
> > You can reset the system time on the server or install the Timezone
> > extension and that should take care of you.
> >
> 
> I am having the same problem and installed the Timezone extensions.
> I can't make it do anything. I read the doc for the extension, but
> regardless of where I add it, I still have the US time zone for my sites.
> 
> So far I've ended up adding 1 day and 7 hours to all events to have them
> show the correct time on my box in Europe.
> 


It's not a solution for _this_ extension, but I've had a similar
problem (though only with a two hour difference) with the extension
'calendar'. This extension uses TS to create the dates in html, so I
have (so far) come up with the following TS to 'shift' the starting
time of events (I haven't done this throughout the entire extension's
TS yet, so I'm not sure if I'm causing myself any problems, but it
works perfectly for start times...):


### Fixes start times. Based on a weird bunch of TS, originally found
at the following page in the T3 English List:
### http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/260/?tx_maillisttofaq_pi1%5Bmode%5D=5&tx_maillisttofaq_pi1%5Bpointer%5D=3
### First, unset the original START_TIME mark:
plugin.tx_calendar_pi1.displayMonth.month.subparts.WEEKS.week.subparts.DAYS.day.subparts.EVENTS.event.marks.START_TIME
>

### Then create it again, but this time as a COA_INT (uncached COA):
plugin.tx_calendar_pi1.displayMonth.month.subparts.WEEKS.week.subparts.DAYS.day.subparts.EVENTS.event.marks.START_TIME
= COA_INT
plugin.tx_calendar_pi1.displayMonth.month.subparts.WEEKS.week.subparts.DAYS.day.subparts.EVENTS.event.marks.START_TIME
{

  ### The first object in the COA array is a temporary TEXT object
that gets the value of the db field 'event_start':
  5 = TEXT
  5.field = event_start

  ### The next object is another TEXT object. This one calls an
outside php function that takes the time
  ### (stored in seconds in the db), and returns it with the value of
'preUserFunc.offset' * 3600 added.
  10 = TEXT
  10 {
    cObject < plugin.tx_calendar_pi1.displayMonth.month.subparts.WEEKS.week.subparts.DAYS.day.subparts.EVENTS.event.marks.START_TIME.5
    preUserFunc = user_timeZoneOffset
    preUserFunc.offset = {$time_zone_offset}
    date = {$event_start_end_php_DATE}

    typolink {
      parameter.field = PAGE_EVENT
      additionalParams {
        field = uid
        wrap = &tx_calendar_pi1[f1]=|
      }
      useCacheHash = 1
    }
  }
  
  ### Unset 5 so it doesn't show on the site:
  5 >
}

I can't access the .php file containing the function
"user_timeZoneOffset" at the moment, but it just takes the number in
the T3 constant named 'time_zone_offset' and returns (time_zone_offset
* 3600), or the number of seconds to add to the start time stored in
the db (I think it's one line long...) The TS object

plugin.tx_calendar_pi1.displayMonth.month.subparts.WEEKS.week.subparts.DAYS.day.subparts.EVENTS.event.marks.START_TIME.10.date
 is just the stdWrap property corresponding to php's 'date()' function
- I think the value of the constant used in that site is 'g:i a'.

Sorry I couldn't answer the problem for the extension you're actually using :-)


-Christopher



More information about the TYPO3-english mailing list