Joe
Joe

Reputation: 4532

How to change button label and time format in p:schedule

I have used schedule from PrimeFaces. How can I change the time format and button label?

Upvotes: 1

Views: 306

Answers (1)

Joe
Joe

Reputation: 4532

As Primefaces used jquery FullCalendar like mentioned by @JasperDeVries in the answer in How to get the event when prev,next are clicked in p:schedule and PrimeFaces has extender functionality (also referred to in the same answer to a different issue) I was able to fix the time format issue with timeFormat="LT" also used extender="initSchedule" to change the button label.

 <h:outputScript>
            function initSchedule() {
                // Configure fullCalendar
                this.cfg.eventOrder = "-title"; // Sort descending order
                this.cfg.buttonText = { today : 'Current Date'};
                    }
    </h:outputScript> 

Upvotes: 3

Related Questions