?
Solved

Have date with event change color in minical

Posted on 2014-01-23
5
Medium Priority
?
377 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month17 days, 4 hours left to enroll

864 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