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
Pages: [1]   Go Down
Print
Author Topic: day color change for out of date  (Read 330 times)
0 Members and 1 Guest are viewing this topic.
Alvy
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: July 19, 2003, 11:12:00 PM »

Is there a way to have the cells background color change if it is older than today?
Kinda like "X'ing" off the calendar days?
This would be regardless of whether there is an event in the day or not. if the day is over, the cell changes color.

Can this be done?

Thanks,
Alvy

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: July 20, 2003, 04:11:00 PM »

The code in the default.html template file responsible for colouring the grid cells is:

<TD CLASS="thinborder" VALIGN=TOP WIDTH=14% <%=$rowheight%> BGCOLOR="<%IF SELECTED%><%=$_GRID_CELL_SELECTED_BGCOLOR%><%ELSE%><%=$_GRID_CELL_BGCOLOR%><%/IF%>">

(all on one line)

You could try changing it to something like:

<% $Grid_day = $DAY->{'yyyy'} . sprintf("%02d",$DAY->{'mm'}) . sprintf("%02d",$DAY->{'dd'}) ; %>

(all on one line)

Followed by

<TD CLASS="thinborder" VALIGN=TOP WIDTH=14% <%=$rowheight%> BGCOLOR="<% if ($TODAY_DATESTRING > $Grid_day) { %>#808080<% } elsif ($DAY->{'selected'}) { %><%=$_GRID_CELL_SELECTED_BGCOLOR%><% } else {%><%=$_GRID_CELL_BGCOLOR%><% } %>">

(all on one line)

Which (if works) should change the background colour of past dated cell grids to #808080. (you could use #000000 to black them out, etc.)

This code is UNtested so make sure you keep a backup of original files.

Dan O.


------------------
July 25, 2003 - Corrected typo noted in the message below.
------------------

[This message has been edited by DanO (edited July 25, 2003).]

Logged
Alvy
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: July 20, 2003, 05:22:00 PM »

<gleeful>

THANKS...so much.. that worked great as far as I can tell.

I have learned so much in one day of reading this forum.
A very adaptable script....

I still have some more work to get it to where I need it, but that is a new thread....

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

Logged
Alvy
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: July 20, 2003, 11:43:00 PM »

One little typo though.. and you would not think it mattered...but there is an extra space at the very of that code that has to be deleted:
} %> ">

should be
} %>">

In IE 6.x.. it was making my cells bright yellow when the it rendered "#FFFFFF " instead of "#FFFFFF"

go figure?

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

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