Skip to content

Commit

Permalink
ZK-2707: Add a timepicker component
Browse files Browse the repository at this point in the history
  • Loading branch information
DevChu committed Apr 29, 2015
1 parent e8c042f commit 846ff0d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions zkthemedemo/src/main/webapp/demo/index.zul
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<item label="Combobox" topic="demo/inputs-combobox" />
<item label="Chosenbox" topic="demo/chosenbox" />
<item label="Checkbox" topic="demo/checkbox" />
<item label="Timepicker" topic="demo/timepicker" />

<category value="Miscellaneous" />
<item label="Button" topic="demo/button" />
Expand Down
36 changes: 36 additions & 0 deletions zkthemedemo/src/main/webapp/demo/timepicker.zul
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<zk>
<zscript><![CDATA[
import java.util.Calendar;
import java.util.Date;

Date time = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(0, 0, 0, 10, 10);
Date min = calendar.getTime();
calendar.set(0, 0, 0, 12, 10);
Date max = calendar.getTime();
]]></zscript>
<vlayout>
<hlayout>
<label value="HH:mm" />
<timepicker format="HH:mm" value="${time}" width="200px"/>
</hlayout>
<hlayout>
<label value="HH:mm a" />
<timepicker format="HH:mm a" value="${time}" min="${min}" width="200px" interval="3600" />
</hlayout>
<hlayout>
<label value="HH:mm:ss" />
<timepicker format="HH:mm:ss" value="${time}" min="${min}" max="${max}" width="200px" interval="3600" />
</hlayout>
<hlayout>
<label value="HH:mm:ss a" />
<timepicker format="HH:mm:ss a" value="${time}" width="200px"/>
</hlayout>
<hlayout>
<label value="hh:mm:ss a" />
<timepicker format="hh:mm:ss a" value="${time}" width="200px"/>
</hlayout>
</vlayout>
</zk>

0 comments on commit 846ff0d

Please sign in to comment.