1
votes

I just upgraded PrimeFaces from 4.2 to 6.2 and I immediately noticed a malfunction of the calendar. In practice when I have the date format set to MMM dd, yyyy hh: mm a the popup button for inserting is no longer displayed.

This is my calendar component in .xhtml page

<p:calendar value="#{pakVeFormA.endDate}"
            pattern="#{languageBean.dtPatterns[languageBean.local]}"  
            mindate="#{pakVeFormA.today}"  
            showOn="button" showButtonPanel="true" 
            readonlyInput="true" timeZone="Asia/Karachi"/>

Where pattern is 'MMM dd, yyyy hh:mm a'

In console appears 'Uncaught Wrong time format'

I noticed that by removing the pattern or mindate the popup button appears correctly. So I've tried to format the new Date() in pakVeFormA Bean but nothing change. I've also tried to inject the min date with static string like ' mindate="Jan 03, 2019 08:00 PM"' but nothing change also this time.

Finally i tried to change pattern to 'MMM dd, yyyy HH:mm' and the calendar work without problem but i need the AM/PM format

Thanks to all

UPDATE: I replicate the test case.

This is the bean

@ManagedBean(name = "testFormBean")
@ViewScoped
public class TestFormBean implements Serializable  {


private static final long serialVersionUID = 1L;

private Date today;
private Date selectedDate;


@PostConstruct
public void init() {
    today=new Date();       
}


public Date getToday() {
    return today;
}

public void setToday(Date today) {
    this.today = today;
}

public Date getSelectedDate() {
    return selectedDate;
}

public void setSelectedDate(Date selectedDate) {
    this.selectedDate = selectedDate;
}
}

And this is the component

<p:calendar value="#{testFormBean.selectedDate}"
        pattern="MMM dd, yyyy hh:mm a"  
        mindate="#{testFormBean.today}"  
        showOn="button" showButtonPanel="true" 
        readonlyInput="true" timeZone="Asia/Karachi"/>

But still not working. If i remove mindate property, all works

1
Can you try a 6.3 snapshot btw? Iirc some things were changed in betweenKukeltje
Where can I find 6.3 .jar ?Rosa Fago
Source, build a snapshot yourselfKukeltje
The bug reported below has been fixed and will be in PF 6.3 upcoming release.Melloware

1 Answers

1
votes

Issue has been reproduced and a bug has been submitted on PF GitHub page:

https://github.com/primefaces/primefaces/issues/4366

Update 01/10/2019: The bug has been fixed and will be in PF 6.3