Search code examples
javazk

ZK datebox can't change hour value


This's my datebox

<datebox value="@bind(vm.myDate)" format="d/M/yyyy hh:mm"/>

I can change day, month, year and minutes, accepted hour. it default to current hour, when I change to other hour it reset to that value.

on my vm myDate is type of java.util.Date

Date myDate;
public Date getMyDate(){
    return myDate;
}
public void setMyDate(Date myDate){
    this.myDate = myDate;
}

Solution

  • ZK cannot decide whether you are meaning AM or PM on input. And therefore - my interpretation - it does nothing.

    You can either add an AM/PM input element like

     format="d/M/yyyy a hh:mm"
    

    or you can set the 24h format:

    format="d/M/yyyy HH:mm"