Locale

Change the locale of the datepicker, schedule and client side validation messages.

Language
English
English
English
French
German
German
German
Italian
Korean
Spanish
Catalan
Dutch
Portuguese
Portuguese
Arabic
Arabic
Bulgarian
Bangla
Bosnian
Czech
Greek
Estonian
Persian
Finnish
Danish
Hindi
Indonesian
Icelandic
Croatian
Japanese
Hungarian
Hebrew
Georgian
Central Kurdish
Khmer
Kyrgyz
Kazakh
Lithuanian
Latvian
Malay
Norwegian
Polish
Romanian
Russian
Slovak
Slovenian
Serbian
Serbian
Swedish
Thai
Turkish
Ukrainian
Uzbek
Vietnamese
Chinese
Chinese

Input Style

Themes

PrimeOne
Saga Blue Saga Blue
Vela Blue Vela Blue
Arya Blue Arya Blue
Bootstrap
Bootstrap Blue Light Bootstrap Blue Light
Bootstrap Purple Light Bootstrap Purple Light
Bootstrap Blue Dark Bootstrap Blue Dark
Bootstrap Purple Dark Bootstrap Purple Dark
Material Design
Material Indigo Light Material Indigo Light
Material Deep Purple Light Material Deep Purple Light
Material Indigo Dark Material Indigo Dark
Material Deep Purple Dark Material Deep Purple Dark
Material Design Compact
Material Compact Indigo Light Material Compact Indigo Light
Material Compact Deep Purple Light Material Compact Deep Purple Light
Material Compact Indigo Dark Material Compact Indigo Dark
Material Compact Deep Purple Dark Material Compact Deep Purple Dark
Legacy
Nova Light Nova Light
Nova Dark Nova Dark
Nova Colored Nova Colored
Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink

Schedule Extender

The schedule component provides many options already, but it does not offer the full suite of options supported by the underlying FullCalendar library. This is an advanced option that lets you configure the schedule to your your needs. Use the extender option and provide a custom JavaScript function. That function is called before the schedule is initialized. Within that function, you can use the this keyword to access the current schedule widget and modify the this.cfg options passed to FullCalendar. See the FullCalendar documentation for more details and all available options.

Extender settings

<div class="card">
    <h:form>
        <p:growl id="messages" widgetVar="messagesGrowl" showDetail="true"
                 globalOnly="true"/>

        <p:panel id="settings" header="Extender settings" styleClass="mb-6">

            <!-- Additional CSS or JavaScript required by the extender example -->
            <h:outputText escape="false"
                          value="#{not empty scheduleJava8View.extenderExample ? scheduleJava8View.extenderExample.html : ''}">
            </h:outputText>

            <p:panelGrid columns="2" layout="flex" styleClass="ui-noborder"
                         columnClasses="col-12 xl:col-12, col-12 xl:col-12">

                <p:selectOneMenu id="examples" label="Examples"
                                 style="width: 100%;"
                                 value="#{scheduleJava8View.selectedExtenderExample}">
                    <f:selectItem noSelectionOption="true"
                                  itemLabel="Select an example..." itemValue=""/>
                    <f:selectItems value="#{scheduleJava8View.extenderExamples}"/>
                    <f:selectItem itemLabel="Custom extender code" itemValue="custom"/>
                    <p:ajax event="change" update="@form" process="@this"
                            listener="#{scheduleJava8View.onExtenderExampleSelect}"/>
                </p:selectOneMenu>

                <p:message id="examplesMessage" escape="false" severity="info"
                           showSummary="true" for="examples"
                           rendered="#{not empty scheduleJava8View.extenderExample}"/>

                <h:outputLink value="#{scheduleJava8View.extenderExample.link}"
                              target="_blank" rel="nofollow noopener"
                              rendered="#{not empty scheduleJava8View.extenderExample and not empty scheduleJava8View.extenderExample.link}">
                    <h:outputText
                            value="See FullCalendar docs for more details on this option."/>
                </h:outputLink>

                <p:inputTextarea id="extenderCustomCode" rows="6"
                                 style="width: 100%;" autoResize="true"
                                 value="#{scheduleJava8View.extenderCode}"
                                 rendered="#{scheduleJava8View.selectedExtenderExample eq 'custom'}"/>

                <ui:fragment
                        rendered="#{not empty scheduleJava8View.extenderExample}">
                    <pre id="extenderCode" name="extenderCode"
                         class="brush:js">#{scheduleJava8View.extenderCode}</pre>
                    <script>SyntaxHighlighter.highlight(document.getElementById('extenderCode'))</script>
                </ui:fragment>

                <ui:fragment
                        rendered="#{not empty scheduleJava8View.extenderExample and not empty scheduleJava8View.extenderExample.html}">
                    <h:outputText
                            value="Additional CSS or JavaScript required for this example"/>
                    <pre id="extenderHtml" name="html"
                         class="brush:html">#{scheduleJava8View.extenderExample.html}</pre>
                    <script>SyntaxHighlighter.highlight(document.getElementById('extenderHtml'))</script>
                </ui:fragment>

                <p:commandButton id="update" styleClass="extender-update"
                                 value="Apply extender and update schedule" process="@form"
                                 update="@form:schedulePanel" icon="pi pi-refresh"/>
            </p:panelGrid>
        </p:panel>

        <p:outputPanel id="schedulePanel">

            <!-- Load the extender and catch errors -->
            <script>
                window.ExtenderShowcase = undefined;
            </script>
            <script>
                window.ExtenderShowcase = function () {
                    try {
                        #{ scheduleJava8View.extenderCode }
                    } catch (e) {
                        console.error("Error while running extender", e);
                        PF("messagesGrowl").renderMessage({
                            severity: "error",
                            summary: "Invalid extender",
                            detail: "The extender you entered threw an error - you might want to check your browser's dev tools. The error was: " + e.message
                        });
                    }
                    // Callback :: eventRender // more about fullcalendar events: https://fullcalendar.io/docs/event-render-hooks
                    this.cfg.options.eventDidMount = function(e) {
                        //Add title as attribute of element
                        if(e.event.title){
                            e.el.setAttribute('customProperty', e.event.title);
                        }
                    };
                };
            </script>
            <script>
                if (typeof window.ExtenderShowcase === "undefined") {
                    PF("messagesGrowl").renderMessage({
                        severity: "error",
                        summary: "Invalid extender",
                        detail: "The extender you entered seems to be syntactically invalid - you might want to check your browser's dev tools."
                    });
                }
            </script>

            <!-- Remote command for deleting events, for the 'delete button' example -->
            <p:remoteCommand id="deleteEvent" name="deleteEvent"
                             actionListener="#{scheduleJava8View.onEventDelete}" process="@this"
                             update="@none" oncomplete="PF('schedule').update()">
            </p:remoteCommand>

            <!-- The actual schedule component -->
            <p:schedule id="schedule" value="#{scheduleJava8View.eventModel}"
                        widgetVar="schedule" extender="window.ExtenderShowcase"
                        timeZone="#{scheduleJava8View.serverTimeZone}" clientTimeZone="#{scheduleJava8View.serverTimeZone}"/>
        </p:outputPanel>
    </h:form>
</div>