Solved

Have date with event change color in minical

Posted on 2014-01-23
5
343 Views
Last Modified: 2014-01-31
I am using the minical.php system for a calendar on our website. Everything is working great, but I need any date with an event to change to a different color.

I am attaching the PHP file here.. any help would be appreciated.

The css for the dates with events is "date-event"

Thanks..
minical.php
0
Comment
Question by:socialbutterfly
  • 3
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 500 total points
ID: 39805493
The best way to do it is to set the style of the td for the respective event day to have some bgcolor.

If I am reading correctly, a day has an event when in_array($i,$activedays) is true, so do something like this:

echo $adj."<td ";
if (in_array($i,$activedays)) echo 'bgcolor="#FF0000" ';

Open in new window


If you want more complex formatting, you may decide to add a style or a class, but this should work for now.
0
 

Author Closing Comment

by:socialbutterfly
ID: 39805595
Thank you soooo much!
0
 

Author Comment

by:socialbutterfly
ID: 39819768
Just found out that this only works on the current month.

I have


if (in_array($i,$activedays))

{ echo 'class=today-event ';
}

if (($i == date('d')) && ($m ==date('m'))){

echo "class=today";

}

 it gives this error when I go to a new month...

Warning in_array()[; Wrong datatype for second argument in ... on line 181
0
 
LVL 24

Expert Comment

by:mankowitz
ID: 39823704
Look at your code. You probably have to reset $activedays whenever you change the month.
0
 

Author Comment

by:socialbutterfly
ID: 39825167
It only does it if there isn't an event for that month. Trying to figure out how to check to see if it is empty or not.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to dynamically set the form action using jQuery.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now