Schedule features

Components, Ajax Framework, Utilities and More.
Post Reply
crogenius
Posts: 20
Joined: 28 Apr 2010, 19:25

10 May 2010, 16:25

Hi,
I want to change the color of event in schedule, but i cant figure how to.
If I do this:

Code: Select all

eventModel.addEvent(new DefaultScheduleEvent("Prckova", new Date(), new Date(),"cssStyle"));
and then i define class in CSS like this:

Code: Select all

.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:

Code: Select all

    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

ufasoli
Posts: 42
Joined: 05 May 2010, 19:55

14 Jun 2010, 17:27

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

CSS file :

Code: Select all



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

}


Code: Select all


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

xeo
Posts: 5
Joined: 17 Nov 2010, 22:48

14 Apr 2011, 16:17

/* 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;
* }
*/

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests