When using custom format function $mdDateLocaleProvider.formatDate placeholder on md-datepicker is not shown. Instead today's date is displayed. Demo on plunker: http://plnkr.co/edit/O5ePYKyo1ILlheMz8KdO?p=preview
If you comment/remove formatDate function from config, placeholder is working.
angular-material version: 1.1.0-rc2
It seems like Moment defaults to today's date if the model is undefined. You can rewrite your function like this:
function formatDate(date) {
return date ? moment(date).format('L') : '';
}
@crisbeto Thanks a lot! This solution solved my issue.
Cool, glad to help.
Thanks!
I had same issue. thanks @crisbeto
Nice, also working for me !!
Most helpful comment
It seems like Moment defaults to today's date if the model is undefined. You can rewrite your function like this: