Home Forums CalendarFX How to set the color for entry in YearMonth view

  • Author
  • NHS
    Post count: 26
    #13096 |

    It seems that the YearMonthview always use yellow to indicate if a day has an entry. Should it use Style like?

    Calendar workingHours = new Calendar(“Working hours”);

    How can the color be set ?

  • Dirk Lemmermann
    Post count: 75
    #13104 |

    The “usage” colors are defined inside calendar.css. If you want to use your own color concept then please start looking into supplying your own cell factory.

  • NHS
    Post count: 26
    #13105 |

    Can you give a tip on how to bind style for each day to any entry on the day having own cell factory

    yearMonthView.setCellFactory(new Callback<LocalDate, Node>() {
    public Node call(LocalDate param) {
    int dayOfMonth = param.getDayOfMonth();
    Label label = new Label(Integer.toString(dayOfMonth));

    // bind?
    return label;

  • NHS
    Post count: 26
    #13106 |

    I solved this by implementing a custom skin

You must be logged in to reply to this topic.