File tree Expand file tree Collapse file tree 4 files changed +19
-10
lines changed Expand file tree Collapse file tree 4 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ For example: <FunctionalCalendar ref="Calendar"></FunctionalCalendar>
159
159
✅ this.$refs.Calendar.NextMonth(); // Call method implementation to go to next month
160
160
✅ this.$refs.Calendar.PreYear(); // Call method implementation to go to previous year
161
161
✅ this.$refs.Calendar.NextYear(); // Call method implementation to go to next year
162
+ ✅ this.$refs.Calendar.ChooseDate('today'); // Call method implementation to go to today
162
163
✅ this.$refs.Calendar.ChooseDate('2018-12-12'); // Call method implementation to go to a date
163
164
````
164
165
___
Original file line number Diff line number Diff line change 6
6
},
7
7
"name" : " vue-functional-calendar" ,
8
8
"description" : " A style-uninstallable datepicker component for Vue.js" ,
9
- "version" : " 2.3.2 " ,
9
+ "version" : " 2.3.3 " ,
10
10
"license" : " MIT" ,
11
11
"repository" : {
12
12
"type" : " git" ,
58
58
"vue" : " ^2.5.21"
59
59
},
60
60
"devDependencies" : {
61
- "@babel/core" : " ^7.2.2 " ,
62
- "@vue/babel-preset-app" : " ^3.3 .0" ,
63
- "@vue/cli-plugin-babel" : " ^3.0.5 " ,
64
- "@vue/cli-plugin-eslint" : " ^3.0.5 " ,
65
- "@vue/cli-service" : " ^3.0.5 " ,
66
- "babel-loader" : " ^8.0.4 " ,
61
+ "@babel/core" : " ^7.4.4 " ,
62
+ "@vue/babel-preset-app" : " ^3.7 .0" ,
63
+ "@vue/cli-plugin-babel" : " ^3.7.0 " ,
64
+ "@vue/cli-plugin-eslint" : " ^3.7.0 " ,
65
+ "@vue/cli-service" : " ^3.7.0 " ,
66
+ "babel-loader" : " ^8.0.6 " ,
67
67
"babel-plugin-transform-es2015-modules-commonjs" : " ^6.26.2" ,
68
68
"css-loader" : " ^1.0.1" ,
69
69
"grunt" : " >=0.4.0" ,
70
70
"grunt-coveralls" : " ^2.0.0" ,
71
71
"jest" : " ^16.0.1" ,
72
72
"less" : " ^3.8.1" ,
73
73
"less-loader" : " ^4.1.0" ,
74
- "node-sass" : " ^4.9.4 " ,
74
+ "node-sass" : " ^4.12.0 " ,
75
75
"sass-loader" : " ^7.1.0" ,
76
76
"sass-resources-loader" : " ^1.3.4" ,
77
77
"stylus" : " ^0.54.5" ,
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
3
<functional-calendar class =" demo-calendar"
4
+ ref =" Calendar"
4
5
v-model =" calendarData2"
5
6
:sunday-start =" true"
6
- :is-modal =" true "
7
+ :is-modal =" false "
7
8
:date-format =" 'dd.mm.yyyy'"
8
9
:change-month-function =" true"
9
10
:is-typeable =" true"
16
17
:hidden-elements =" ['leftAndRightDays']"
17
18
></functional-calendar >
18
19
20
+ <button @click =" $refs.Calendar.ChooseDate('today')" >Today</button >
19
21
<!-- <functional-calendar class="demo-calendar2"-->
20
22
<!-- v-model="calendarData"-->
21
23
<!-- :sunday-start="true"-->
Original file line number Diff line number Diff line change 606
606
this .$emit (' changedYear' , this .calendar .currentDate );
607
607
},
608
608
ChooseDate (date ) {
609
- this .calendar .currentDate = helpCalendar .getDateFromFormat (date);
609
+ let newDate = helpCalendar .getDateFromFormat (date);
610
+
611
+ if (date === ' today' ){
612
+ newDate = new Date ();
613
+ }
614
+
615
+ this .calendar .currentDate = newDate;
610
616
this .initCalendar ();
611
617
},
612
618
openMonthPicker () {
You can’t perform that action at this time.
0 commit comments