Created
December 5, 2011 10:37
-
-
Save oliverdaff/1433169 to your computer and use it in GitHub Desktop.
Simple PlayFramework Date Picker tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="clearfix"> | |
| <label for="time">Time</label> | |
| <div class="input"> | |
| <select class="small" name="hour" id="hour" size="1"> | |
| #{list items:0..23, as:'i'}<option value="${i}" | |
| #{if new Date().format('HH') == Integer.toString(i) }selected="true"#{/if}>${i}:00</option>#{/list} | |
| </select> | |
| </div> | |
| </div> | |
| <div class="clearfix"> | |
| <label>Date</label> | |
| <div class="input"> | |
| <select class="mini" name="dayOfMonth" id="dayOfMonth" size="1"> | |
| #{list items:1..31, as:'i'}<option value="${i}" | |
| #{if new Date().format('d') == Integer.toString(i) }selected="true"#{/if}>${i}</option>#{/list} | |
| </select> | |
| <select class="medium" name="month" id="month" size="1"> | |
| #{list items: | |
| ["January", "February", | |
| "March", "April", "May", "June", "July", | |
| "August", "September", "October", "November", | |
| "December" | |
| ], as:'i'}<option value="${i}" | |
| #{if new Date().format('MMMM') == i }selected="true"#{/if}>${i}</option>#{/list} | |
| </select> | |
| <select class="small" name="year" id="year" size="1"> | |
| #{list items:2010..2011, as:'i'}<option value="${i}" | |
| #{if new Date().format('yyyy') == Integer.toString(i) }selected="true"#{/if}>${i}</option>#{/list} | |
| </select> | |
| </div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment