You could do it as follows:
jQuery(document).on('ready page:change', function() {
var datefields = jQuery("[data-behaviour~='my-datepicker']");
datefields.each(function(){
$(this).datetimepicker({
format: $(this).attr('data-dateformat') || ($(this).attr('data-allowblank') ? 'd-m-Y' : 'Y-m-d'),
timepicker:false,
allowBlank: $(this).attr('data-allowblank'),
lang: $(this).attr('data-lang') || 'en'
});
});
});
Or simply specify it in the data-dateformat
attribute in the HTML code.