Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)display earlier events in another color
Pages: [1]   Go Down
Print
Author Topic: display earlier events in another color  (Read 250 times)
0 Members and 1 Guest are viewing this topic.
stevea
Guest
« on: September 17, 2003, 01:54:00 PM »

This is related to my previous question to start listing events at current time.

In this question I would like a template to list current or future events in a different color that past events for the day.

Example... I have 5 events, three starting earlier than current time. Two current or later...

lets say current time is 1pm

9AM - event1 (list in grey)
10:30 AM - event2 (list in grey)
11:00 AM - event3 (list in grey)
1:00 pm - event4 (list in normal color)
5:00 pm - even5 (list in normal color)

thanks,
Steve
(grey'd out)

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: September 17, 2003, 04:45:00 PM »

** I have 5 events, three starting earlier than current time. Two current or later... **

I don't think CalendarScript has a special variable for the current time so you would likely have to try using the Perl time function to get the current server time to use in a comparison. Eg.

<%
if ($EVENT->{'schedule'}->{'start'} < time)
{
$color = "grey";
}
else
{
$color = "Whatever_Your_Normal_Colos_Is";
}
%>

Then use <%= $color %> in the appropriate place to change the color of the text.

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: