ltwCalendar
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsProjectsltwCalendar

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 10th, 2003, 01:33 PM
Leigh Leigh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ontario, Canada
Posts: 99 Leigh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 20 sec
Reputation Power: 3
How to colour in weekend?

Can some kind soul point me in the direction of how to colour the weekend cells so they stand out from the weekdays? I've managed to colour the empty cells (i.e. cells without a date in them) without much ado but the weekends have thrown me.

Reply With Quote
  #2  
Old November 10th, 2003, 05:57 PM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: How to colour in weekend?

I'd do something like this......

In ltwdisplaymonth.php:
1) add two class vars
var $sat_dow = 6;
var $sun_dow = 0;

2) modify the constructor(~line 69)

Old
=======================================
if ( $this->week_starts_monday == 1 ){
$this->first_day_of_month = $this->first_day_of_month-1;
if ( $this->first_day_of_month < 0 ) $this->first_day_of_month = 6;
}

New
=======================================
if ( $this->week_starts_monday == 1 ){
$this->first_day_of_month = $this->first_day_of_month-1;
if ( $this->first_day_of_month < 0 ) $this->first_day_of_month = 6;
$this->sat_dow = 5; // NEW LINE
$this->sun_dow = 6; // NEW LINE
}


3) Modify the <td> code (~line 191)

Old (1 line only)
=======================================
echo "<td class="cal" width="14%" height="" . (100 / $num_of_rows) . "%">";

New (7 lines total)
=======================================
echo "<td class="cal" width="14%" height="" . (100 / $num_of_rows) . "%" ";
if ( ($j = $this->sat_dow) || ($j = $this->sun_dow) ){
// weekend color
echo " bgcolor="0x000000" ";
}else{
// weekday color
echo " bgcolor="0xFFFFFF" ";
}
echo " >";

I'd probably make the different colors config params so you don't have to change code to modify them.

!!Disclaimer!!
I have not tested this code on a working system, so the syntax may not be 100% correct. But it should be close enough to get you going.

Reply With Quote
  #3  
Old January 12th, 2004, 07:43 PM
pcSnoopy pcSnoopy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 pcSnoopy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: How to colour in weekend?

i copied the td.cal in ltw_style.css to td.cal_sunson and changed the background-color. the modified code at ltwdisplaymonth.php looks now like this:

echo "<td width="14%" height="" . (100 / $num_of_rows) . "%" ";
if ( ($j == $this->sat_dow) || ($j == $this->sun_dow) ){
// weekend color
echo " class="cal_sunson" ";
}else{
// weekday color
echo " class="cal" ";
}
echo " >";

Reply With Quote
Reply

Viewing: Codewalkers ForumsProjectsltwCalendar > How to colour in weekend?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek