Skip to content

Commit 696fc77

Browse files
committed
AltField and AltFormat Demos
Added demo codes for AltField and AltFormat in Unix and ODBC date formats.
1 parent 4e07b30 commit 696fc77

File tree

2 files changed

+55
-4
lines changed

2 files changed

+55
-4
lines changed

demo/examples.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ $(document).ready(function() {
9494
title: 'MonthPicker Dialog Test',
9595
modal: true
9696
});
97+
98+
$('#AltMonthField').MonthPicker({
99+
SelectedMonth: 'Jan, 2016',
100+
MonthFormat: 'M, yy', // Short month name, Full year.
101+
AltFormat: '@', // Unix time stamp.
102+
AltField: '#serverValue' // Selector for hidden input.
103+
});
104+
105+
$('#AltMonthField2').MonthPicker({
106+
SelectedMonth: 'Jan, 2016',
107+
MonthFormat: 'M, yy', // Short month name, Full year.
108+
AltFormat: 'yy-dd-mm', // ODBC time stamp.
109+
AltField: '#serverValue2' // Selector for hidden input.
110+
});
97111

98112
$("h1").text( $("h1").text().replace('@VERSION', $.MonthPicker.VERSION) );
99113
});

demo/index.html

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,42 @@ <h3>Month Format Demonstration</h3>
188188
<option value="MM &apos;in the year&apos; yy">With text - MM 'in the year' yy</option>
189189
</select>
190190
</p>
191-
192-
<h3>Inline Menu Demonstration</h3>
191+
192+
<h3>Alternate Field/Format Demonstration</h3>
193193
<p>
194-
This demonstrates the Month Picker menu inlined in a div tag.
195-
<div id='InlineMenu'></div>
194+
This demonstrates how the <a href='https://github.com/KidSysco/jquery-ui-month-picker/wiki/AltField-Option' target="_blank">AltField</a> and
195+
<a href='https://github.com/KidSysco/jquery-ui-month-picker/wiki/AltFormat-Option' target="_blank">AltFormat</a> options work so that values shown to the user can be different than what is submitted to the server.
196+
<table style="margin-top: -25px;">
197+
<tr>
198+
<td>Value shown to user:</td>
199+
<td>&nbsp; &nbsp; </td>
200+
<td>Unix Date value sent to server:</td>
201+
</tr>
202+
<tr>
203+
<td><input id="AltMonthField" style='width:100px;' /></td>
204+
<td>&nbsp; &nbsp; </td>
205+
<td><input name='selectedMonth' id="serverValue" />
206+
<!-- This could be a hidden input, I made it a text so you cen see what gets sent to the server -->
207+
</td>
208+
</tr>
209+
<tr>
210+
<td>&nbsp;</td>
211+
<td>&nbsp;</td>
212+
<td>&nbsp;</td>
213+
</tr>
214+
<tr>
215+
<td>Value shown to user:</td>
216+
<td>&nbsp; &nbsp; </td>
217+
<td>ODBC Date value sent to server:</td>
218+
</tr>
219+
<tr>
220+
<td><input id="AltMonthField2" style='width:100px;' /></td>
221+
<td>&nbsp; &nbsp; </td>
222+
<td><input name='selectedMonth2' id="serverValue2" />
223+
<!-- This could be a hidden input, I made it a text so you cen see what gets sent to the server -->
224+
</td>
225+
</tr>
226+
</table>
196227
</p>
197228

198229
<h3>jQuery UI Dialog Integration Demonstration</h3>
@@ -202,6 +233,12 @@ <h3>jQuery UI Dialog Integration Demonstration</h3>
202233
<br />
203234
<button type="button" id="LaunchDialog" onclick="$('#Modal').dialog('open');">Launch Dialog</button>
204235
</p>
236+
237+
<h3>Inline Menu Demonstration</h3>
238+
<p>
239+
This demonstrates the Month Picker menu inlined in a div tag.
240+
<div id='InlineMenu'></div>
241+
</p>
205242

206243
<h3>HTML 5 Month Input Type Support</h3>
207244
<p>

0 commit comments

Comments
 (0)