Skip to content

Commit f3c7e48

Browse files
committed
update
Add selectedDateToShow option
1 parent c836c08 commit f3c7e48

9 files changed

Lines changed: 37 additions & 51 deletions

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ Name | Values | Description | Sample
5353
**isGregorian** | [false], true | Is calendar Gregorian
5454
**inLine** | [false], true | Is date time picker in line
5555
**modalMode** | [false], true | Open in modal mode, suitable for smart phones
56-
**selectedDate** | [undefined], new Date() | Selected date as JavaScript Date object | new Date('2018/9/30')
56+
**selectedDate** | [undefined], Date | Selected date as JavaScript Date object | new Date('2018/9/30')
57+
**selectedDateToShow** | [new Date()], Date | Selected date to show as JavaScript Date object | new Date('2018/9/30')
5758
**selectedRangeDate** | Array: Date[] | Selected range date as JavaScript Date object | [new Date('2020/8/5'), new Date('2020/8/15')]
5859
**monthsToShow** | Numeric array with 2 items, [0 ,0] | To show, number of month before and after selected date in date time picker, first item is for before month, second item is for after month | [1, 1]
5960
**yearOffset** | Number | Number of years to select in year selector | 30

demo/SamplesToDebug.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ <h2>Simple</h2>
3030
<div class="input-group-prepend">
3131
<span class="input-group-text cursor-pointer" id="dt_class">Icon</span>
3232
</div>
33-
<input type="text" id="inputDate3" class="form-control" value="2019-09-22">
33+
<input type="text" id="inputDate3" class="form-control">
3434
</div>
3535
<label id="showDate_class"> </label>
3636
</div>
3737
</div>
3838
</div>
3939

40-
<script src="../src/jquery.md.bootstrap.datetimepicker.js" type="text/javascript"></script>
40+
<script src="../dist/jquery.md.bootstrap.datetimepicker.js" type="text/javascript"></script>
4141

4242
<script type="text/javascript">
4343
$("#dt_class").MdPersianDateTimePicker({
@@ -47,6 +47,7 @@ <h2>Simple</h2>
4747
isGregorian: false,
4848
modalMode: false,
4949
englishNumber: false,
50+
selectedDateToShow: new Date(2020, 10, 01),
5051
calendarViewOnChange: function(param1){
5152
console.log(param1);
5253
}

dist/jquery.md.bootstrap.datetimepicker.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.md.bootstrap.datetimepicker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.md.bootstrap.datetimepicker.style.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.md.bootstrap.datetimepicker.style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "md.bootstrappersiandatetimepicker",
3-
"version": "3.9.2",
3+
"version": "3.10.0",
44
"description": "Persian Date Time Picker with jQuery 3+ & Bootstrap 4+",
55
"license": "MIT",
66
"moduleResolution": "node",
@@ -17,24 +17,22 @@
1717
"homepage": "https://github.com/Mds92/MD.BootstrapPersianDateTimePicker",
1818
"dependencies": {
1919
"@popperjs/core": "^2.4.4",
20-
"bootstrap": "^4.5.2",
21-
"jquery": "^3.4.1",
22-
"npm": "^6.14.8"
20+
"bootstrap": "^4.5.3",
21+
"jquery": "^3.5.1"
2322
},
2423
"devDependencies": {
25-
"@types/jquery": "^3.5.1",
26-
"css-loader": "^1.0.1",
27-
"extract-text-webpack-plugin": "^4.0.0-beta.0",
24+
"@types/jquery": "^3.5.5",
25+
"css-loader": "^5.0.1",
26+
"extract-text-webpack-plugin": "^3.0.2",
2827
"jshint": "^2.12.0",
2928
"jshint-loader": "^0.8.4",
30-
"mini-css-extract-plugin": "^0.4.5",
31-
"style-loader": "^0.23.1",
32-
"uglifyjs-webpack-plugin": "^1.3.0",
33-
"webpack": "^4.44.1",
34-
"webpack-cli": "^3.3.12",
35-
"webpack-dev-server": "^3.11.0",
36-
"webpack-fix-style-only-entries": "0.0.4",
37-
"webpack-merge": "^4.2.2"
29+
"mini-css-extract-plugin": "^1.3.3",
30+
"style-loader": "^2.0.0",
31+
"webpack": "^5.12.2",
32+
"webpack-cli": "^4.3.1",
33+
"webpack-dev-server": "^3.11.1",
34+
"webpack-fix-style-only-entries": "^0.6.0",
35+
"webpack-merge": "^5.7.3"
3836
},
3937
"scripts": {
4038
"compile": "tsc",

src/jquery.md.bootstrap.datetimepicker.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Bootstrap 4+ Persian Date Time Picker jQuery Plugin
3-
* version : 3.9.2
3+
* version : 3.10.0
44
* https://github.com/Mds92/MD.BootstrapPersianDateTimePicker
55
*
66
*
@@ -10,8 +10,6 @@
1010
* My weblog: mds-soft.persianblog.ir
1111
*/
1212

13-
14-
1513
(function ($) {
1614

1715
// #region jalali calendar
@@ -2068,7 +2066,7 @@
20682066
hideOthers($this);
20692067
showPopover($this);
20702068
setTimeout(function () {
2071-
setting.selectedDateToShow = setting.selectedDate != undefined ? getClonedDate(setting.selectedDate) : new Date();
2069+
setting.selectedDateToShow = setting.selectedDate != undefined ? getClonedDate(setting.selectedDate) : getClonedDate(setting.selectedDateToShow);
20722070
var calendarHtml = getDateTimePickerHtml(setting);
20732071
setPopoverHeaderHtml($this, setting.inLine, $(calendarHtml).find('[data-selecteddatestring]').text().trim());
20742072
getPopover($this).find('[data-name="mds-datetimepicker-body"]').html(calendarHtml);

webpack.config.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
const webpack = require('webpack');
2-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
3-
const ExtractTextPlugin = require("extract-text-webpack-plugin");
42
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
53
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
4+
const TerserPlugin = require('terser-webpack-plugin');
65

76
module.exports = {
87
entry: {
@@ -20,13 +19,9 @@ module.exports = {
2019
watchContentBase: true
2120
},
2221
optimization: {
23-
minimizer: [
24-
new UglifyJsPlugin({
25-
test: /\.js$/i,
26-
sourceMap: true,
27-
parallel: true
28-
})
29-
]
22+
minimizer: [new TerserPlugin({
23+
extractComments: false,
24+
})],
3025
},
3126
module: {
3227
rules:
@@ -46,13 +41,6 @@ module.exports = {
4641
}
4742
]
4843
},
49-
// {
50-
// test: /\.css$/,
51-
// use: [
52-
// { loader: "style-loader" },
53-
// { loader: "css-loader" }
54-
// ]
55-
// },
5644
{
5745
test: /\.css$/,
5846
use: [
@@ -76,8 +64,8 @@ module.exports = {
7664
banner: `
7765
Bootstrap 4+ Persian Date Time Picker jQuery Plugin
7866
https://github.com/Mds92/MD.BootstrapPersianDateTimePicker
79-
version : 3.9.2
80-
Written By Mohammad Dayyan, Mordad 1397 - 1399
67+
version : 3.10.0
68+
Written By Mohammad Dayyan, Mordad 1397 - 1400
8169
mds.soft@gmail.com - @mdssoft
8270
8371
`

0 commit comments

Comments
 (0)