2

Welcome. I wanted to add the calendar with PrimeFaces on my website. I want to use the TimePicker to also be able to set the time. So looks like my calendar:

<p:calendar value="#{visitMB.visit.dateVisit}" pattern="dd-MM-yyyy HH:mm:ss" locale="tr" navigator="true" showButtonPanel="true" mode="inline" mindate="now"/>

When I set the pattern: dd-MM-yyyy without the time everything is added correctly, but when I change to: dd-MM-yyyy HH:mm:ss I get this error:

j_idt10:j_idt12: '19-06-2013' could not be understood as a date and time.

This is when I set the inline mode, when I set the popup is all ok.

I have a problem with the localization my calendar.

I create the file polski.js:

<script type="text/javascript">
PrimeFaces.locales['pl'] = {
    closeText: 'Zamknij',
    prevText: 'Poprzedni',
    nextText: 'Następny',
    monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
    monthNamesShort: ['Sty','Lut','Mar','Kwi','Maj','Cze', 'Lip','Sie','Wrz','Paź','Lis','Gru'],
    dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
    dayNamesShort: ['Nie','Pon','Wt','Śr','Czw','Pt','So'],
    dayNamesMin: ['N','P','W','Ś','Cz','P','S'],
    weekHeader: 'Tydzień',
    firstDay: 1,
    isRTL: false,
    showMonthAfterYear: false,
    yearSuffix: 'r',
    timeOnlyTitle: 'Tylko czas',
    timeText: 'Czas',
    hourText: 'Godzina',
    minuteText: 'Minuta',
    secondText: 'Sekunda',
    currentText: 'Teraz',
    ampm: false,
    month: 'Miesiąc',
    week: 'Tydzień',
    day: 'Dzień',
    allDayText : 'Cały dzień'
};
</script>

and in my page i added:

        <h:outputScript name="C:\Users\Piotr\Desktop\polski.js" />
        <p:calendar value="#{visitMB.visit.dateVisit}" pattern="dd-MM-yyyy HH:mm:ss" locale="pl" navigator="true"  mode="inline" mindate="now"/>

But localization don't work. Why?

2

0

Your Answer

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

Browse other questions tagged or ask your own question.