I'm formatting a date with the following code:
$('#test-dp-component .input-group.date').datepicker({
format:'yyyy/mm/dd',
}).datepicker("setDate",'{{ $module->test }}');
So if the date is September 1, 2021, the displayed format is 2021/09/01. However, if I change the format like this:
$('#test-dp-component .input-group.date').datepicker({
format:'mm/dd/yyyy',
}).datepicker("setDate",'{{ $module->test }}');
Then it returns 05/09/1 instead of 09/01/2021. Other formats like mm/yyyy seem to work fine, so why is it freaking out over the mm/dd/yyyy format? Any suggestions?