Browse Source

Fix date picker problem

pull/18693/head
Salih 2 years ago
parent
commit
1eb5d8db7b
  1. 27
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/date-range-picker/date-range-picker-extensions.js

27
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/date-range-picker/date-range-picker-extensions.js

@ -176,30 +176,20 @@
for(var format of formats) {
var date = moment(value, format);
if(date.isValid()) {
return maybeUtc(date, options);
return date;
}
}
}
if (value.isAbpDate) {
return maybeUtc(value._moment.clone(), options);
return value._moment.clone();
}
if(value.isLuxonDateTime) {
return maybeUtc(moment(value.toISO()), options);
return moment(value.toISO());
}
return maybeUtc(moment(value), options);
}
function maybeUtc(date, options) {
if (options.isUtc) {
date = date.utc();
}else{
date = date.local();
}
return date;
return moment(value);
}
function getTodayButton(options, $dateRangePicker) {
@ -430,6 +420,11 @@
function formatHiddenDate(date, options) {
date = convertToMoment(date, options, options.inputDateFormat);
if (date.isValid()) {
if (options.isUtc) {
date = date.utc();
}else{
date = date.local();
}
if (options.isIso) {
return date.toISOString();
}
@ -705,6 +700,10 @@
});
}
abp.dom.onNodeAdded(function (args) {
abp.dom.initializers.initializeDateRangePickers(args.$el);
});
$(function () {
abp.dom.initializers.initializeDateRangePickers($('body'));
});

Loading…
Cancel
Save