$(function () {
    var dateFields = $('.date-time-picker');

    var initializeDatePicker = function (elem) {
        var fieldData = $(elem).data('date-option');
        if (fieldData == 'mm') {
            $(elem).datepicker({
                format: "mm/yyyy",
                startView: 1,
                minViewMode: 1
            });
        } else {
            $(elem).datepicker({
                format: "dd/mm/yyyy",
                todayHighlight: true
            });
        }
    };

    dateFields.map(function (_, dtField) {
        initializeDatePicker(dtField);
    });
});
$(function () {
    var $date_option = $('.date-time-picker').data('date-option');
    if ($date_option == "mm") {
        $('.date-time-picker').datepicker({
            format: "mm/yyyy",
            startView: 1,
            minViewMode: 1
        });
    } else {
        $('.date-time-picker').datepicker({
            format: "dd/mm/yyyy",
            todayHighlight: true
        });

    }

});
--- 
+++ 
@@ -1,23 +1,17 @@
 $(function () {
-    var dateFields = $('.date-time-picker');
+    var $date_option = $('.date-time-picker').data('date-option');
+    if ($date_option == "mm") {
+        $('.date-time-picker').datepicker({
+            format: "mm/yyyy",
+            startView: 1,
+            minViewMode: 1
+        });
+    } else {
+        $('.date-time-picker').datepicker({
+            format: "dd/mm/yyyy",
+            todayHighlight: true
+        });
 
-    var initializeDatePicker = function (elem) {
-        var fieldData = $(elem).data('date-option');
-        if (fieldData == 'mm') {
-            $(elem).datepicker({
-                format: "mm/yyyy",
-                startView: 1,
-                minViewMode: 1
-            });
-        } else {
-            $(elem).datepicker({
-                format: "dd/mm/yyyy",
-                todayHighlight: true
-            });
-        }
-    };
+    }
 
-    dateFields.map(function (_, dtField) {
-        initializeDatePicker(dtField);
-    });
 });
Fix date format datepickers when multiple datepickers are on the page
