jQuery datepicker
has a function called altFormat
, which allows you to display a date format to the user, while using another as value.
How do I show 01/01/1970 to user while having 1970-01-01 as value?
Example
$(document).ready(function(){
$('.pickadate').datepicker({
format: "yyyy-mm-dd",
language: "pt-BR",
daysOfWeekDisabled: [0,6],
autoclose: false,
todayHighlight: true
}).on('changeDate', function(e){
$(this).val(e.format('dd/mm/yyyy')); //My pifious tries
});
$('.pickadate').on('hide', function(e) {
$(this).val(e.format('dd/mm/yyyy'));
});
});