Fantastic script. I’m running into only one issue. I have the demo unmodified on my server and the mini calendar, default and iCal example all work brilliantly. But for some reason the Event List does not load. It will show the snippet call and template files list, but under that no events ever load. But all the other calendar examples work flawlessly. Any idea why this could be happening? I have not modified any of the code, just looking at the demos on my server.
The event list is kind of buggy. It needs some work.
If it’s just events in a month, I would recommend just using the calendar type, but using UL - LI for the templating- if that makes sense (get rid of the tables).
Hey Eli,
- That seems to be a bug on the iCal one. Are the placeholders the same in the templates?
- The all day thing is pretty frustrating. There’s some code out there that show how to do that (I think the Drupal module does some checking for it. If you hack it or find any code that work for it, Im all ears. The original modx GCal has the same problem.
Hi,
First of all: great Snippet! The posibilities are endless!
One thing though:
I’d like to use a 24h notation instead of the AM/PM. Where and how do ik change that?
Hey Jorgen,
You can use PHX to format [+startDate+] however you’d like such as 24h
So if i use PHx i can replace the output.
But what does [+startDate+] parse? Is it like a PHP ’strftime’ time format?
If so, i try to get the right syntax but can’t seem to get it right.
e.g. [+startdate+] gives an output of: Oct 1, 09 7:00
Which i want to convert to ’19:00’.
So I use:
[+phx:input=`[+startDate+]`:is=date`%b %m, %g %I:%M`:then=date`%H:%M`+]
Nothing happens.
I am able to convert the output string as whole, but that’s of course not the way to go.
I understand this is more of PHx question, but if you can tell which format the [+startDate+] is in, it will help me a lot.
Chuck,
how do I start the days with a different day. Now Sunday is the first day of the week, what about Mondays?
Wouldn’t it be better to change the template parts to use template chunks? Or would you like to keep it this way?
My final thought is, should we try and create the navigation of the ’ical’ template to be via Ajax? It think this would be much better, than simply posting the variables in the URL.
Hey Jorgen,
Sorry about that, it should’ve been [+sortDate+]. Looking at the code, it doesnt reflect the offset, but that’s where you do it. You could also change the code (around line 97) to:
'startDate' => $startDate - $offset,
'endDate' => $endDate - $offset,
'pubDate' => $item->get_publish_date() -$offset,
@boudie,
No I dont want these to be template chunks. You can make your version do that if you wish. And you can definitely use ajax for the navigation. Should be simple with some jquery.