Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mds92 committed Sep 13, 2020
1 parent ada5915 commit 57bd305
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/jquery.md.bootstrap.datetimepicker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jquery.md.bootstrap.datetimepicker.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jquery.md.bootstrap.datetimepicker.style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "3.9.1",
"version": "3.9.2",
"description": "Persian Date Time Picker with jQuery 3+ & Bootstrap 4+",
"license": "MIT",
"moduleResolution": "node",
Expand Down
11 changes: 7 additions & 4 deletions src/jquery.md.bootstrap.datetimepicker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Bootstrap 4+ Persian Date Time Picker jQuery Plugin
* version : 3.9.1
* version : 3.9.2
* https://github.com/Mds92/MD.BootstrapPersianDateTimePicker
*
*
Expand Down Expand Up @@ -528,7 +528,7 @@
if (setting.selectedDate == undefined) return '';
if (setting.rangeSelector && setting.rangeSelectorStartDate != undefined && setting.rangeSelectorEndDate != undefined)
return getDateTimeString(!setting.isGregorian ? getDateTimeJsonPersian1(setting.rangeSelectorStartDate) : getDateTimeJson1(setting.rangeSelectorStartDate), setting.textFormat, setting.isGregorian, setting.englishNumber) + ' - ' +
getDateTimeString(!setting.isGregorian ? getDateTimeJsonPersian1(setting.rangeSelectorEndDate) : getDateTimeJson1(setting.rangeSelectorEndDate), setting.textFormat, setting.isGregorian, setting.englishNumber);
getDateTimeString(!setting.isGregorian ? getDateTimeJsonPersian1(setting.rangeSelectorEndDate) : getDateTimeJson1(setting.rangeSelectorEndDate), setting.textFormat, setting.isGregorian, setting.englishNumber);
return getDateTimeString(!setting.isGregorian ? getDateTimeJsonPersian1(setting.selectedDate) : getDateTimeJson1(setting.selectedDate), setting.textFormat, setting.isGregorian, setting.englishNumber);
}

Expand Down Expand Up @@ -1751,10 +1751,10 @@
dateNumber = Number($this.attr('data-number')),
setting = getSetting1($this),
selectedDateJson = setting.selectedDate == undefined ? undefined : getDateTimeJson1(setting.selectedDate),
selectedDateToShow = getClonedDate(setting.selectedDateToShow);
selectedDateToShow = getClonedDate(setting.selectedDateToShow),
selectedDateToShowJson = selectedDateToShow == undefined ? undefined : getDateTimeJson1(selectedDateToShow);
if (disabled) return;
selectedDateToShow = getDateTime4(dateNumber, selectedDateToShow, setting);

if (setting.rangeSelector) { // اگر رنج سلکتور فعال بود
if (setting.rangeSelectorStartDate != undefined && setting.rangeSelectorEndDate != undefined) {
setting.selectedRangeDate = [];
Expand Down Expand Up @@ -1786,6 +1786,9 @@
setting.selectedDate = getClonedDate(selectedDateToShow);
setting.selectedDateToShow = getClonedDate(selectedDateToShow);
if (selectedDateJson != undefined) {
selectedDateJson.hour = selectedDateToShowJson.hour;
selectedDateJson.minute = selectedDateToShowJson.minute;
selectedDateJson.second = selectedDateToShowJson.second;
setting.selectedDate.setHours(selectedDateJson.hour);
setting.selectedDate.setMinutes(selectedDateJson.minute);
setting.selectedDate.setSeconds(selectedDateJson.second);
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = {
banner: `
Bootstrap 4+ Persian Date Time Picker jQuery Plugin
https://github.com/Mds92/MD.BootstrapPersianDateTimePicker
version : 3.9.1
version : 3.9.2
Written By Mohammad Dayyan, Mordad 1397 - 1399
[email protected] - @mdssoft
Expand Down

0 comments on commit 57bd305

Please sign in to comment.