jQueryUI Datepicker: Show one date format to user, use another date format in the background(I have done this bit)
- I need help and can't figure this out.I can get the format date i want(2017-02-13) yy-mm-dd and use it in my code
no problem but i don't want to display this to users.I want to display dd/mm/yyyy.
Not sure what i'm missing tried everything below as you can see
See my code below:-
- $('#dateto').datepicker({
- altField: "#_dateto",
- altFormat: 'dd/mm/yy',
- dateFormat: 'yy-mm-dd',
- showOn: 'button',
- buttonText: 'Select Date',
- //buttonImageOnly: true,
- autoSize: true,
- //showButtonPanel: true,
- buttonImage: "/SiteAssets/CustomBranding/Calendar.gif",
- buttonImageOnly: true,
- onSelect: function (dateText, inst) {
- //$(this).parent('form').submit();
- //alert("You selected: " + dateText);
- //var hiddenDate = $("[name='altInput']").attr('value');
- //$("#myDate").text(hiddenDate);
- //alert('Current #OnSelectDate value: ' + $("#_dateto").val());
- //$("#dateto").val($("#_dateto").val());
- }
- });
- <fieldset>
- <label>To Date</label><input type="text" name="date" id="dateto">
- <input id="_dateto" type="hidden" value="">
- </fieldset>
THanks in Advance