0

Due to a very extensive plugin I do not want to mess in the core files to change the dateFormat. Calling the dateFormat in an alternative script is not bringing any changes, so I am looking for an alternative solution. This is my case:

Based on this thread and answer I wanted to change the existing dd-mm-yy datepicker format into a d MM format. I had to hide the year with jQuery from the datepicker and the input field, by using the previous mentioned source:

jQuery('#user_birthday').datepicker({
    beforeShow: function (input, inst) {
        inst.dpDiv.addClass('no-year-shown');
    },
    onClose: function(dateText, inst){
        inst.dpDiv.removeClass('no-year-shown');
    }
});

The years disappeared with this great solution, however the outcome is for example: December\07 while the original displayed dateformat was 07-12-2018. How do I override this, so it's 7 December (EU format).

Demian
  • 536
  • 5
  • 26

1 Answers1

0

How about using DateFormat Option:

$( "#user_birthday" ).datepicker({ dateFormat: "dd-MM" });

sunoce
  • 1
  • 3