File tree Expand file tree Collapse file tree 3 files changed +39
-10
lines changed Expand file tree Collapse file tree 3 files changed +39
-10
lines changed Original file line number Diff line number Diff line change 8
8
:change-month-function =" true"
9
9
:is-typeable =" true"
10
10
:change-year-function =" true"
11
+ :is-date-picker =" false"
11
12
:is-date-range =" true"
12
13
:is-multiple =" false"
13
14
:calendars-count =" 2"
56
57
data () {
57
58
return {
58
59
calendarData: {},
59
- calendarData2: {},
60
+ calendarData2: {
61
+ dateRange: {
62
+ start: ' 19.4.2019' ,
63
+ end: ' 25.4.2019'
64
+ }
65
+ },
60
66
calendar: {
61
67
dateRange: {
62
68
Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ export default {
39
39
40
40
return new Date ( date [ year ] , date [ month ] - 1 , date [ day ] ) ;
41
41
} ,
42
+ checkValidDate ( val ) {
43
+ val = this . getDateFromFormat ( val ) ;
44
+
45
+ if ( val != "Invalid Date" ) {
46
+ return true ;
47
+ }
48
+
49
+ return false ;
50
+ } ,
42
51
getWeeksInMonth ( month , year ) {
43
52
let weeks = [ ] ,
44
53
firstDate = new Date ( year , month , 1 ) ,
Original file line number Diff line number Diff line change 220
220
this .calendar .selectedDate = val;
221
221
this .markChooseDays ();
222
222
}
223
+
224
+ // Typeable
225
+ if (helpCalendar .checkValidDate (val) && this .fConfigs .isTypeable ) {
226
+ this .ChooseDate (val);
227
+ }
223
228
}
224
229
},
225
230
' input.dateRange.start' : {
229
234
this .calendar .dateRange .start = val;
230
235
this .markChooseDays ();
231
236
}
237
+
238
+ // Typeable
239
+ if (helpCalendar .checkValidDate (val) && this .fConfigs .isTypeable ) {
240
+ this .ChooseDate (val);
241
+ }
232
242
}
233
243
},
234
244
' input.dateRange.end' : {
238
248
this .calendar .dateRange .end = val;
239
249
this .markChooseDays ();
240
250
}
251
+
252
+ // Typeable
253
+ if (helpCalendar .checkValidDate (val) && this .fConfigs .isTypeable ) {
254
+ this .ChooseDate (val);
255
+ }
241
256
}
242
257
}
243
258
},
250
265
helpCalendar .configs .dayNames = this .fConfigs .dayNames ;
251
266
helpCalendar .configs .monthNames = this .fConfigs .monthNames ;
252
267
253
-
254
- // Sunday Start
255
- if (this .fConfigs .sundayStart ) {
256
- let dayNames = this .fConfigs .dayNames ;
257
- let sundayName = dayNames[dayNames .length - 1 ];
258
- dayNames .splice (dayNames .length - 1 , 1 );
259
- dayNames .unshift (sundayName);
260
- }
261
-
262
268
this .setCalendarData ();
263
269
this .listRendering ();
264
270
this .markChooseDays ();
313
319
// New Date
314
320
this .calendar .currentDate = this .newCurrentDate ;
315
321
}
322
+
323
+ // Sunday Start
324
+ if (this .fConfigs .sundayStart ) {
325
+ let dayNames = this .fConfigs .dayNames ;
326
+ let sundayName = dayNames[dayNames .length - 1 ];
327
+ dayNames .splice (dayNames .length - 1 , 1 );
328
+ dayNames .unshift (sundayName);
329
+ }
316
330
},
317
331
listRendering () {
318
332
let vm = this ;
You can’t perform that action at this time.
0 commit comments