0

I want to show holidays and weekends (Fridays & Saturdays) in custom style. Is there any attribute provided by PrimeFaces to do this, or what should I do to build a custom component from existing <p:calendar>.

Without using javascript or jquery.

Thanks in advance.

Regards, Sunny

1
  • 2
    Looking at the documentation (what you must have done before posting the question) there's no other way than using Javascript. If you don't agree with this, go complain with PrimeFaces guys, not here. Oct 23, 2012 at 6:17

2 Answers 2

2

I think can achieve without writing a custom core custom component.

Create a composite component and use java script to highlight the custom dates you are interested in.

onClick(call the below function on P:cal)

function updatedaysHighlighter(){
    var rows = document.getElementById('ui-datepicker-div').getElementsByTagName("tr");
    if(days.length>1)  {
       alert(days[4].innerHTML);
    }
}

You can try playing with td and update the class value for each td as like you want.

0

Its not supported by primeface...

There is a New Feature Request about this exact feature , and one of the comments requested holidays too

You can vote for it Issue 1805: New feature for Calendar: receive a list of Dates to highlight them

But in the meanwhile you better do it yourself using jquery (highlight holidays in datepicker jquery)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.