Browse Source

extract abp.libs.bootstrapDatepicker.getOptions method.

pull/4161/head
Halil İbrahim Kalkan 6 years ago
parent
commit
4fb273935e
  1. 23
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js

23
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js

@ -100,6 +100,13 @@
.fromISO(isoFormattedValue, { .fromISO(isoFormattedValue, {
locale: abp.localization.currentCulture.name locale: abp.localization.currentCulture.name
}).toLocaleString(); }).toLocaleString();
},
getOptions($input){ //$input may needed if developer wants to override this method
return {
todayBtn: "linked",
autoclose: true,
language: abp.libs.bootstrapDatepicker.mapLanguageName(abp.localization.currentCulture.cultureName)
};
} }
}; };
@ -108,15 +115,13 @@
.findWithSelf('input.datepicker,input[type=date]') .findWithSelf('input.datepicker,input[type=date]')
.each(function () { .each(function () {
var $input = $(this); var $input = $(this);
$input.attr('type', 'text'); $input
$input.val(abp.libs.bootstrapDatepicker.getFormattedValue($input.val())) .attr('type', 'text')
$input.datepicker({ .val(abp.libs.bootstrapDatepicker.getFormattedValue($input.val()))
todayBtn: "linked", .datepicker(abp.libs.bootstrapDatepicker.getOptions($input))
autoclose: true, .on('hide', function (e) {
language: abp.libs.bootstrapDatepicker.mapLanguageName(abp.localization.currentCulture.cultureName) e.stopPropagation();
}).on('hide', function (e) { });
e.stopPropagation();
});
}); });
} }

Loading…
Cancel
Save