|
22 | 22 | xmlns:g="urn:import:com.google.gwt.user.client.ui" |
23 | 23 | xmlns:m="urn:import:gwt.material.design.client.ui" |
24 | 24 | xmlns:demo="urn:import:gwt.material.design.demo.client.ui"> |
| 25 | + <ui:style gss="true"> |
| 26 | + @external format-table; |
| 27 | + |
| 28 | + table.format-table tr td { |
| 29 | + padding: 20px; |
| 30 | + } |
| 31 | + </ui:style> |
25 | 32 | <g:HTMLPanel> |
26 | 33 | <m:MaterialRow addStyleNames="code"> |
27 | 34 | <m:MaterialTitle title="Basic" description="You can easily add placeholder to indicate a label into your datepicker."/> |
|
118 | 125 |
|
119 | 126 | <m:MaterialRow addStyleNames="code"> |
120 | 127 | <m:MaterialTitle title="Formats" description="You can set the format of the date picker by adding format='FORMAT'"/> |
121 | | - <m:MaterialDatePicker ui:field="dpFormat" grid="s12" placeholder="Custom Format" format="Yehey yyyy mm dd"/> |
| 128 | + <m:MaterialDatePicker ui:field="dpFormat" grid="s12" placeholder="Custom Format" format="YYYY/MM/DD"/> |
122 | 129 | <m:MaterialButton ui:field="btnSetFormat" text="Set Date with custom format"/> |
123 | 130 |
|
124 | 131 | <demo:PrettyPre addStyleNames="lang-xml"> |
125 | 132 |  <m:MaterialDatePicker ui:field="dpFormat" placeholder="Custom Format" format="yyyy mm dd"/> |
126 | 133 | </demo:PrettyPre> |
127 | 134 | </m:MaterialRow> |
128 | | - |
| 135 | + |
| 136 | + <m:MaterialRow addStyleNames="code"> |
| 137 | + <m:MaterialTitle title="Formatting Rules" description="The following rules can be used to format any date supported by Pickadate JS (Our core datepicker API)" /> |
| 138 | + <g:HTMLPanel> |
| 139 | + <table class="format-table striped"> |
| 140 | + <thead> |
| 141 | + <tr> |
| 142 | + <th>Rule</th> |
| 143 | + <th>Description</th> |
| 144 | + <th>Result</th> |
| 145 | + </tr> |
| 146 | + </thead> |
| 147 | + |
| 148 | + <tbody> |
| 149 | + <tr> |
| 150 | + <td>d</td> |
| 151 | + <td>Date of the month</td> |
| 152 | + <td>1 – 31</td> |
| 153 | + </tr> |
| 154 | + <tr> |
| 155 | + <td>dd</td> |
| 156 | + <td>Date of the month with a leading zero</td> |
| 157 | + <td>01 – 31</td> |
| 158 | + </tr> |
| 159 | + <tr> |
| 160 | + <td>ddd</td> |
| 161 | + <td>Day of the week in short form</td> |
| 162 | + <td>Sun – Sat</td> |
| 163 | + </tr> |
| 164 | + <tr> |
| 165 | + <td>dddd</td> |
| 166 | + <td>Day of the week in full form</td> |
| 167 | + <td>Sunday – Saturday</td> |
| 168 | + </tr> |
| 169 | + <tr> |
| 170 | + <td>m</td> |
| 171 | + <td>Month of the year</td> |
| 172 | + <td>1 – 12</td> |
| 173 | + </tr> |
| 174 | + <tr> |
| 175 | + <td>mm</td> |
| 176 | + <td>Month of the year with a leading zero</td> |
| 177 | + <td>01 – 12</td> |
| 178 | + </tr> |
| 179 | + <tr> |
| 180 | + <td>mmm</td> |
| 181 | + <td>Month name in short form</td> |
| 182 | + <td>Jan – Dec</td> |
| 183 | + </tr> |
| 184 | + <tr> |
| 185 | + <td>mmmm</td> |
| 186 | + <td>Month name in full form</td> |
| 187 | + <td>January – December</td> |
| 188 | + </tr> |
| 189 | + <tr> |
| 190 | + <td>yy</td> |
| 191 | + <td>Year in short form *</td> |
| 192 | + <td>00 – 99</td> |
| 193 | + </tr> |
| 194 | + <tr> |
| 195 | + <td>yyyy</td> |
| 196 | + <td>Year in full form</td> |
| 197 | + <td>2000 – 2999</td> |
| 198 | + </tr> |
| 199 | + </tbody> |
| 200 | + </table> |
| 201 | + </g:HTMLPanel> |
| 202 | + </m:MaterialRow> |
| 203 | + |
129 | 204 | <m:MaterialRow addStyleNames="code"> |
130 | 205 | <m:MaterialTitle title="Date Limit" description="You can limit the date by calling setDateLimit(Date min, Date max) method."/> |
131 | 206 | <m:MaterialDatePicker ui:field="dpLimit" placeholder="With Limit"/> |
|
0 commit comments