Skip to content

Commit

Permalink
رفع مشکل
Browse files Browse the repository at this point in the history
  • Loading branch information
Mds92 committed Mar 13, 2023
1 parent 9efc495 commit 9a9b468
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion dist/mds.bs.datetimepicker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mds.bs.datetimepicker.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md.bootstrappersiandatetimepicker",
"version": "4.2.3",
"version": "4.2.4",
"description": "Persian Date Time Picker with Bootstrap 5+",
"license": "MIT",
"moduleResolution": "node",
Expand Down
41 changes: 22 additions & 19 deletions src/mds.bs.datetimepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,19 @@ export class MdsPersianDateTimePicker {

// #region Template

private static modalHtmlTemplate = `<div data-mds-dtp data-mds-dtp-guid="{{guid}}" class="modal fade mds-bs-persian-datetime-picker-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" data-mds-dtp-title="true">
<h5 class="modal-title">Modal title</h5>
</div>
<div class="modal-body">
<div class="select-year-box w-0" data-mds-dtp-year-list-box="true"></div>
<div data-name="mds-dtp-body"></div>
</div>
</div>
</div>
private static modalHtmlTemplate =
`<div data-mds-dtp data-mds-dtp-guid="{{guid}}" class="modal fade mds-bs-persian-datetime-picker-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" data-mds-dtp-title="true">
<h5 class="modal-title">Modal title</h5>
</div>
<div class="modal-body">
<div class="select-year-box w-0" data-mds-dtp-year-list-box="true"></div>
<div data-name="mds-dtp-body"></div>
</div>
</div>
</div>
</div>`;
private static popoverHtmlTemplate = `<div class="popover mds-bs-persian-datetime-picker-popover" role="tooltip" data-mds-dtp>
<div class="popover-arrow"></div>
Expand Down Expand Up @@ -1749,16 +1750,18 @@ data-bs-toggle="dropdown" aria-expanded="false">
const calendarHtml = this.getDateTimePickerBodyHtml(setting);
const dtpInlineHeader = calendarHtml.match(/<th mds-dtp-inline-header\b[^>]*>(.*?)<\/th>/img)![0];
this.tempTitleString = dtpInlineHeader;
if (!setting.inLine && updatePopoverContent) {
if (!setting.inLine && updatePopoverContent && !setting.modalMode) {
const popover = this.getBsPopoverInstance();
if (!popover) {
console.error("mds.bs.datetimepicker: `BsPopoverInstance` is null!");
return;
}
popover.setContent({
'.popover-header': dtpInlineHeader,
'.popover-body': calendarHtml
});
setTimeout(() => {
popover.setContent({
'.popover-header': dtpInlineHeader,
'.popover-body': calendarHtml
});
}, 100);
return;
}
let containerElement = element.closest('[data-name="mds-dtp-body"]');
Expand Down Expand Up @@ -1849,9 +1852,9 @@ data-bs-toggle="dropdown" aria-expanded="false">
MdsPersianDateTimePickerData.set(instance.guid, instance);
if (setting.rangeSelectorStartDate != undefined && setting.rangeSelectorEndDate != undefined) {
setting.selectedRangeDate = [MdsPersianDateTimePicker.getClonedDate(setting.rangeSelectorStartDate), MdsPersianDateTimePicker.getClonedDate(setting.rangeSelectorEndDate)];
if (!setting.inLine) {
if (!setting.inLine)
instance.hide();
} else
else
this.updateCalendarBodyHtml(element, setting);
}
return;
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports = {
banner: `
Bootstrap 5+ Persian Date Time Picker
https://github.com/Mds92/MD.BootstrapPersianDateTimePicker
version : 4.2.3
version : 4.2.4
Written By Mohammad Dayyan, Mordad 1397 - 1402
[email protected] - @mdssoft
`
Expand Down

0 comments on commit 9a9b468

Please sign in to comment.