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
  #1  
Old January 28th, 2004, 09:02 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Hightlight Current Day

How would i get it to highlight the current day? Nice calendar btw.

Reply With Quote
  #2  
Old February 12th, 2004, 02:05 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

I was able to "sort of" take care of this; by adding a class to the stylesheet called "td.curday"

defined the background color in there...

Then I added the following code to line 245 of ltwdisplaymonth

$thisday = $date("j,l,Y");

(just below function displayMonth() )

Then I added the following to the section on ltwdisplaymonth that defines the TD (which is somewhere around line 389 in my editor:

echo "<td class="curday" width="14%" height="" . (100 / $num_of_rows) . "%">";

$this->_popup_link("day",$this->php_self."?display=day&stamp=".$this->stamp."&day=".$day."&returnto=month",$day);

echo "<br>";

} else {

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

$this->_popup_link("day",$this->php_self."?display=day&stamp=".$this->stamp."&day=".$day."&returnto=month",$day);

echo "<br>"; }

(that's more of an edit actually)

However, the only problem I'm working on ironing out is WHY it's now highlighting not only TODAYS date, but every "12th" of EVERY month.

Reply With Quote
  #3  
Old March 9th, 2004, 03:40 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

I changed your code to highlight only the current day. First I created the style as you did, and called it td.cal-today. Then I changed to the following lines in displayMonth():

php Code:
Original - php Code
  1.  
  2.     // date to store in DB is CREATED like this
  3.     $today   = date('Y-m-d',strtotime($this->year . "-" . $this->month . "-" . $day));
  4.     $todayTS = strtotime($today);
  5.  
  6.     if ($today == date("Y-m-d")) {
  7.         $cal="cal-today";
  8.     } else {
  9.         $cal="cal";
  10.     }
  11.  
  12.     echo "<td class="$cal" width="14%" height="" . (100 / $num_of_rows) . "%">";
  13. $this->_popup_link("day",$this->php_self."?display=day&stamp=".$this->stamp."&day=".$day."&returnto=month",$day);
  14.     echo "<br>";


I re-ordered the $today calculation to make it easier to compare against today, and inserted a variable into the class statement.

Richard

Reply With Quote
  #4  
Old March 12th, 2004, 01:19 PM
rsleegers rsleegers is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: London, ON, CANADA
Posts: 5 rsleegers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 59 sec
Reputation Power: 0
RE: Hightlight Current Day

Quote:
Richard


Thought that I would lift the veil of anonymity and claim that I wrote the above.

Richard

Reply With Quote
  #5  
Old March 15th, 2004, 01:05 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

Thanks a bunch. I'll throw that in and see how it works

Reply With Quote
  #6  
Old April 5th, 2004, 08:07 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

Ok, I am able to get the day to show in lightblue. If I change the css "table.cal" to yellow the whole thing goes yellow. If I take out the "table.cal-today" it doesn't work.

I don't mind having the highlight being lightblue, but the day shows in the center. I can't seem to get it to work.

Please HELP !

here is what I added to the css file


table.cal-today {
background-color: lightblue;^M
height: 600px;^M
border-style: none;^M
border-width: 3px;^M
font-family: sans-serif^M
}



Thanks,
Matt

Reply With Quote
  #7  
Old April 6th, 2004, 05:23 PM
rsleegers rsleegers is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: London, ON, CANADA
Posts: 5 rsleegers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 59 sec
Reputation Power: 0
RE: Hightlight Current Day

Take a look at the default definition:
Quote:
td.cal {
background-color: white;
text-align: left;
vertical-align: top;
}

Looks like you're missing the text-align and vertical-align settings. Also, you're using table.cal-today instead of td.cal-today. You want to modify the column, not the entire table... I think it should be like this:
Quote:
td.cal-today {
background-color: lightblue;
text-align: left;
vertical-align: top;
}

Reply With Quote
  #8  
Old April 6th, 2004, 07:27 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

Thanks that worked.

-Matt

Reply With Quote
  #9  
Old April 10th, 2004, 06:02 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

Hi,

I've tried to modify the displaymonth and I keep getting a parse error. I was wondering if you could help me figure out what I've done wrong.

The main problem I can't figure out is where to add the code you guys posted here. On my display month the " $today = date('Y-m-d',str..." is not part of the "echo "<td class="cal" wi..."

I've tried different variations, i.e., adding all the code to one area, breaking it up, and just using part of it, but I still get the parse/fatal error.

Any suggestions?

Reply With Quote
  #10  
Old October 25th, 2004, 06:10 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

Here's where the code should go (this is in my version 4.1.3 code):

echo "<tbody>n";
for ( $i = 1; $i <= $num_of_rows; $i++ ){
echo "<tr>n";
for ( $j = 0; $j < 7; $j++ ){
if ( (($i == 1) && ($this->first_day_of_month <= $j)) || (($i > 1) && ($day <= $this->days_in_month)) ){

// date to store in DB is CREATED like this
$today = date('Y-m-d',strtotime($this->year . "-" . $this->month . "-" . $day));
$todayTS = strtotime($today);

if ($today == date("Y-m-d")) {
$cal="cal-today";
} else {
$cal="cal";
}

echo "<td class="$cal" width="14%" height="" . (100 / $num_of_rows) . "%">";
$this->_popup_link("day",$this->php_self."?display=day&stamp=".$this->stamp."&day=".$day."&returnto=month",$day);
echo "<br>";

Reply With Quote
  #11  
Old October 25th, 2004, 06:11 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hightlight Current Day

Here's where the code should go (this is in my version 4.1.3 code):

echo "<tbody>n";
for ( $i = 1; $i <= $num_of_rows; $i++ ){
echo "<tr>n";
for ( $j = 0; $j < 7; $j++ ){
if ( (($i == 1) && ($this->first_day_of_month <= $j)) || (($i > 1) && ($day <= $this->days_in_month)) ){

// date to store in DB is CREATED like this
$today = date('Y-m-d',strtotime($this->year . "-" . $this->month . "-" . $day));
$todayTS = strtotime($today);

if ($today == date("Y-m-d")) {
$cal="cal-today";
} else {
$cal="cal";
}

echo "<td class="$cal" width="14%" height="" . (100 / $num_of_rows) . "%">";
$this->_popup_link("day",$this->php_self."?display=day&stamp=".$this->stamp."&day=".$day."&returnto=month",$day);
echo "<br>";

Reply With Quote
  #12  
Old July 12th, 2006, 01:19 AM
linda1122 linda1122 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 linda1122 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to linda1122 Send a message via AIM to linda1122 Send a message via Yahoo to linda1122
RE: Hightlight Current Day

thanx...i got it..

Reply With Quote
Reply

Viewing: Codewalkers ForumsProjectsltwCalendar > Hightlight Current Day


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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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