Thanks to all you CalendarScript forum supporters!
------------------David WolpoNextGen Software, Inc.www.NextGenSoftware.comdavidw@nextgensoftware.com
David
Date : <%= $MONTH_NAME %> <%= $DATE %>, <%= $YEAR %>
That would put:
Date : May 1, 2002
On the screen, if you are looking at an event that occurs on May 1, 2002, that is.
------------------David Whittaker http://www.uabcm.com/ http://www.csworkbench.com/
And I noticed when I use
code:<%= $EVENT2->{schedule}->{date} %>
<%= $EVENT2->{schedule}->{date} %>
(this uses the time display MOD) recurring events show the first date of the event, not the current date.
Help!
[This message has been edited by davidw (edited May 01, 2002).]
Thanks!
------------------Stephanie MeemkenWebmaster, Minnesota Jayceeshttp://www.mnjaycees.org/
<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"><%= EVENT FIELD(title) %></A><BR>
and add the datestring to it, like this:
<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>&datestring=<%= $DAY->{datestring} %>" CLASS="gridtext"><%= EVENT FIELD(title) %></A><BR>
There may be another one of those in other month or week views, but the all look fairly similar. Add that, and the script will parse the datestring out into month, month name, day, and year. Enjoy!
code:<%= &SimpleDateFormat::formatDate($EVENT->{'schedule'}->{'nextoccurrence'}->{'start'},$Config->get("date_format")) %>
<%= &SimpleDateFormat::formatDate($EVENT->{'schedule'}->{'nextoccurrence'}->{'start'},$Config->get("date_format")) %>
code:elsif ($VIEW eq "Event") { $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BEvents; $fields = &main: BGetFieldsInDisplayOrder($db); }
elsif ($VIEW eq "Event") { $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BEvents; $fields = &main: BGetFieldsInDisplayOrder($db); }
Change it to this:
code:elsif ($VIEW eq "Event") { $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BSchedule; $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1); foreach (@$schedules) { if ($_->{event_id} == $EVENT->{details}->{id}) { $EVENT->{schedule} = $_; last; } } $db = $main: BEvents; $fields = &main: BGetFieldsInDisplayOrder($db); }
elsif ($VIEW eq "Event") { $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BSchedule; $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1); foreach (@$schedules) { if ($_->{event_id} == $EVENT->{details}->{id}) { $EVENT->{schedule} = $_; last; } } $db = $main: BEvents; $fields = &main: BGetFieldsInDisplayOrder($db); }
That will make $EVENT->{schedule} exist so you can use it for whatever in the event view. Enjoy!
OK, Here's the hack (using the Time Display MOD):
code:<!--#include file="styles.pl"--><%# Begin the code...# -----------------sub LZ { my($x)=shift;if(length($x)==1){return "0$x";}return $x; }require "SimpleDateFormat.pm";
<!--#include file="styles.pl"--><%# Begin the code...# -----------------sub LZ { my($x)=shift;if(length($x)==1){return "0$x";}return $x; }require "SimpleDateFormat.pm";
code:<% if ($EVENT2->{'schedule'}->{'start'}) { print &SimpleDateFormat::formatDate($EVENT2->{'schedule'}->{'start'}, $Config->get(date_format)) } %><% if ($EVENT2->{'schedule'}->{'end'} ne $EVENT2->{'schedule'}->{'start'}) { print " - ", &SimpleDateFormat::formatDate($EVENT2->{'schedule'}->{'end'}, $Config->get(date_format)) } %>
<% if ($EVENT2->{'schedule'}->{'start'}) { print &SimpleDateFormat::formatDate($EVENT2->{'schedule'}->{'start'}, $Config->get(date_format)) } %><% if ($EVENT2->{'schedule'}->{'end'} ne $EVENT2->{'schedule'}->{'start'}) { print " - ", &SimpleDateFormat::formatDate($EVENT2->{'schedule'}->{'end'}, $Config->get(date_format)) } %>
PS: I've hacked my calendar to use an event_details.html popup window, so I'm not passing to a different display for default.html.
------------------Stephanie MeemkenWebmaster, Minnesota Jaycees http://www.mnjaycees.org/
[This message has been edited by kayleigh (edited May 02, 2002).]
Does your solution, which presents the recurring event's From-To dates, also able to display the date of this event occurance? i.e. the event recurs daily from 5:00-6:00pm, May 1 - May 5. From the grid or list view, I click on the event for May 3rd. Does your solution show May 3, or the entire date range? For a contiguous event, showing the range is ok.
But what if you are meeting the 3rd Tuesday or each month. What does your solution show for the date?
I'm not much good at reading this code yet, but I'm learning!