Reputation: 1362
I want to display the date only without the time on the text , but it seems that it didn't work even I've set the format of the datepicker. And also I dont want to display the Time in the datepicker. Please see image below, I want to remove the yellow highlighted.
var defaultFormat = { dateFormat: 'mm/dd/yy' };
$.datepicker.setDefaults(defaultFormat);
$('#EM_Date').datetimepicker({
showHour: false,
showMinute: false
});
Upvotes: 4
Views: 27836
Reputation: 866
Function:
<script type="text/javascript">
$(function () {
$('.datePicker').datepicker({ dateFormat: 'yy-mm-dd' });
});
</script>
Input Field
<input type="text" name="date" id="date" class="datePicker" />
Example (date format dd/mm/yy):
Upvotes: 1
Reputation: 296
use this format,
$('.picker').datetimepicker({ dateFormat:dateFormat: 'mm/dd/yy' '', timeFormat: 'hh:mm tt', dateonly:true });
Upvotes: 1