Board index JavaServer Faces General Schedule features

Schedule features

Components, Ajax Framework, Utilities and More.

Post 10 May 2010, 16:25

Posts: 20
Hi,
I want to change the color of event in schedule, but i cant figure how to.
If I do this:
eventModel.addEvent(new DefaultScheduleEvent("Prckova", new Date(), new Date(),"cssStyle"));

and then i define class in CSS like this:
.cssStyle{
    background-color:red !important;
    border-style: solid !important;
    border-color: red !important;
    color: white !important;
}

The events are still blue with red line:
Image
If i look at the page, i think, that:
1) The user style should be define closer to the event, co it overwrite the attributes.
2) Not define the color of css atributes: .fc-event, .fc-agenda .fc-event-time, .fc-event a
And my next questin is about selectEvent:
When I receive the event, i need to do correction of the time, because the event shows me yesterday. Is this something about the different timezones i am?
The right date display me after this code:
    public void onDateSelect(DateSelectEvent selectEvent) {
        Date ref = new Date(selectEvent.getDate().getTime()+HOURS*MINUTES*SECONDS*MILISECONDS);
        event = new DefaultScheduleEvent(Math.random() + "", ref, ref);
    }

where HOURS*MINUTES*SECONDS*MILISECONDS = miliseconds per one day.
NetBeans 6.9
JSF 2.0
GlassFish v 3
PrimeFaces 2.2.M1

Post 14 Jun 2010, 17:27

Posts: 42
Hi,
I run into the same problem a few weeks ago and I've managed to solve it like this :

CSS file :



.red-class{
   
    border-color: #CC6600!important;
}
.red-class a{
   background-color: #CC6600!important;

}






eventModel.addEvent(new DefaultScheduleEvent("Title", new Date(), new Date(),"red-class"));



it's not perfect but it did the trick for me, hope it helps

Post 14 Apr 2011, 16:17
xeo

Posts: 5
/* Use the 'className' CalEvent property and the following
* example CSS to change event color on a per-event basis:
*
* .myclass,
* .fc-agenda .myclass .fc-event-time,
* .myclass a {
* background-color: black;
* border-color: black;
* color: red;
* }
*/


Return to General