Skip to content

Commit 4fe0a66

Browse files
committed
Added time picker functionality for date picker.
1 parent ab111d3 commit 4fe0a66

File tree

8 files changed

+258
-66
lines changed

8 files changed

+258
-66
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ ___
125125
| dateFormat | String | 'dd/mm/yyyy' | 'yyyy/mm/dd' | Date formatting string |
126126
| isDatePicker | Boolean | false | true | Enable or disable date picker |
127127
| isDateRange | Boolean | false | true | Enable or disable date range |
128+
| withTimePicker | Boolean | false | true | Enable or disable time picker, working only with isDatePicker |
128129
| isMultiple | Boolean | false | true | Enable multiple calendar function |
129130
| calendarsCount | Number | 1 | 3 | Count of calendars, working only is prop isMultiple |
130131
| isModal | Boolean | false | true | Enable modal calendar function |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"name": "vue-functional-calendar",
88
"description": "A style-uninstallable datepicker component for Vue.js",
9-
"version": "2.3.4",
9+
"version": "2.3.5",
1010
"license": "MIT",
1111
"repository": {
1212
"type": "git",

src/Demo.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
ref="Calendar"
55
v-model="calendarData2"
66
:sunday-start="false"
7-
:is-modal="false"
8-
:date-format="'dd.mm.yyyy'"
7+
:is-modal="true"
8+
:date-format="'yyyy-mm-dd'"
99
:change-month-function="true"
1010
:is-typeable="true"
1111
:change-year-function="true"
12-
:is-date-picker="false"
13-
:is-date-range="true"
12+
:is-date-picker="true"
13+
:is-date-range="false"
14+
:with-time-picker="true"
1415
:is-multiple="false"
1516
:calendars-count="2"
1617
:marked-date-range="{start: '22.4.2019', end: '24.4.2019'}"
@@ -109,7 +110,7 @@
109110
}
110111
111112
.demo-calendar {
112-
width: 30%
113+
width: 20%
113114
}
114115
115116
.demo-calendar2 {

src/assets/icons/angle-down-solid.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/icons/angle-up-solid.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/scss/calendar.scss

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ input.vfc-single-input {
7070
}
7171

7272
.vfc-months {
73-
flex:1 1 75%;
73+
flex: 1 1 75%;
7474
padding: 0;
7575
display: flex;
7676
flex-wrap: wrap;
@@ -111,6 +111,101 @@ input.vfc-single-input {
111111
}
112112
}
113113

114+
.vfc-time-picker-container {
115+
height: 100%;
116+
display: flex;
117+
flex-direction: column;
118+
justify-content: center;
119+
120+
.vfc-close {
121+
position: absolute;
122+
right: 32px;
123+
top: 32px;
124+
width: 32px;
125+
height: 32px;
126+
opacity: 0.3;
127+
}
128+
.vfc-close:hover {
129+
opacity: 1;
130+
}
131+
.vfc-close:before, .vfc-close:after {
132+
position: absolute;
133+
left: 15px;
134+
content: ' ';
135+
height: 33px;
136+
width: 2px;
137+
background-color: #333;
138+
}
139+
.vfc-close:before {
140+
transform: rotate(45deg);
141+
}
142+
.vfc-close:after {
143+
transform: rotate(-45deg);
144+
}
145+
146+
.vfc-modal-time-mechanic {
147+
position: relative;
148+
width: 40%;
149+
margin: 0 auto;
150+
.vfc-modal-time-line {
151+
text-align: center;
152+
color: #7d7d7d;
153+
font-size: 20px;
154+
padding-top: 15px;
155+
padding-bottom: 15px;
156+
}
157+
}
158+
159+
.vfc-modal-append {
160+
color: #7d7d7d;
161+
font-weight: normal;
162+
display: flex;
163+
justify-content: space-between;
164+
.vfc-arrow {
165+
opacity: 0.3;
166+
transition: 0.2s;
167+
}
168+
.vfc-arrow:hover {
169+
opacity: 1;
170+
}
171+
.vfc-arrow-up {
172+
width: 0;
173+
height: 0;
174+
border-left: 20px solid transparent;
175+
border-right: 20px solid transparent;
176+
border-bottom: 20px solid #333333;
177+
}
178+
.vfc-arrow-down {
179+
width: 0;
180+
height: 0;
181+
border-left: 20px solid transparent;
182+
border-right: 20px solid transparent;
183+
border-top: 20px solid #333333;
184+
}
185+
}
186+
187+
.vfc-modal-midle {
188+
display: inline-block;
189+
}
190+
191+
.vfc-modal-midle-dig {
192+
display: inline-block;
193+
text-align: center;
194+
}
195+
196+
.vfc-modal-digits {
197+
display: flex;
198+
justify-content: space-between;
199+
font-size: 50px;
200+
select {
201+
margin: 5px 0;
202+
width: 100%;
203+
text-align: center;
204+
text-align-last:center;
205+
}
206+
}
207+
}
208+
114209
.vfc-navigation-buttons {
115210
flex: 0 1 15%;
116211
margin-top: -10px;
@@ -171,7 +266,7 @@ input.vfc-single-input {
171266
}
172267

173268
.vfc-calendars {
174-
flex:1 1 75%;
269+
flex: 1 1 75%;
175270
display: flex;
176271

177272
.vfc-calendar {
@@ -185,6 +280,7 @@ input.vfc-single-input {
185280
&.vfc-content {
186281
margin: 0 20px;
187282
z-index: 100;
283+
188284
h2 {
189285
&.vfc-top-date {
190286
text-align: center;

0 commit comments

Comments
 (0)