Skip to content

Commit abc72d3

Browse files
Fixed q-date,q-time and Added q-scroll-area
1 parent eeebd86 commit abc72d3

File tree

2 files changed

+54
-21
lines changed

2 files changed

+54
-21
lines changed

quasar_app/src/layouts/MainLayout.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<q-layout view="lHh Lpr fff" class="bg-grey-1">
3-
<router-view />
3+
<q-page-container>
4+
<router-view />
5+
</q-page-container>
46
<q-footer bordered class="bg-white text-black text-center q-pa-sm">
57
<span class="">© 2020-2021 Saurav Jaiswal.</span>
68
</q-footer>
@@ -13,17 +15,10 @@
1315
export default {
1416
data() {
1517
return {
16-
leftDrawerOpen: false,
1718
links1: [
1819
{icon: 'list_alt', text: 'TODO', path: '/'},
1920
],
2021
}
21-
},
22-
computed: {
23-
24-
},
25-
methods: {
26-
2722
}
2823
}
2924
</script>

quasar_app/src/pages/Index.vue

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
2-
<q-page padding>
2+
<q-page >
3+
<div class="q-pa-sm absolute full-width full-height column">
34
<div class="typewriter text-center q-mb-lg q-mt-lg" v-if="$q.platform.is.desktop">
45
<h1 class="text-bold">
56
Todo Application
@@ -16,13 +17,16 @@
1617
<q-icon name="search"/>
1718
</template>
1819
</q-input>
20+
1921
<q-banner class="bg-primary text-white" v-if="Object.keys(uncompletedTask).length == 0">
2022
No, Task to do Today !
2123
<template v-slot:action>
2224
<q-btn flat color="white" label="ADD TASK" @click="openAddTaskDialogBox"/>
2325

2426
</template>
2527
</q-banner>
28+
<q-scroll-area class="q-scroll-area-task" :thumb-style="thumbStyle"
29+
:bar-style="barStyle">
2630
<transition
2731
appear
2832
enter-active-class="animated zoomIn"
@@ -106,12 +110,13 @@
106110
</q-list>
107111
</div>
108112
</transition>
113+
</q-scroll-area>
109114

110115

111-
<div class="absolute-bottom text-center q-mb-lg">
116+
<div class="fixed-bottom text-center no-pointer-events" style="bottom: 45px" >
112117
<!-- <q-btn icon="add" round color="primary" size="24px" @click="openAddTaskDialogBox"></q-btn>-->
113-
<q-fab color="purple" icon="keyboard_arrow_up" direction="up">
114-
<q-fab-action color="primary" @click="openAddTaskDialogBox" icon="add" />
118+
<q-fab color="purple" icon="keyboard_arrow_up" direction="up" class="all-pointer-events">
119+
<q-fab-action color="primary" @click="openAddTaskDialogBox" icon="add" class="all-pointer-events" />
115120
</q-fab>
116121

117122
</div>
@@ -128,12 +133,12 @@
128133
ref="name" label="Task Name"/>
129134
</div>
130135
<div class=" q-mb-sm">
131-
<q-input outlined v-model="task.due_date" mask="date" ref="date"
136+
<q-input :options="currentDate" outlined v-model="task.due_date" mask="date" ref="date"
132137
:rules="[val => !!val || 'Date is required']" label="Date">
133138
<template v-slot:append>
134139
<q-icon name="event" class="cursor-pointer">
135140
<q-popup-proxy ref="due_date" transition-show="scale" transition-hide="scale">
136-
<q-date v-model="task.due_date" @input="() => $refs.due_date.hide()"/>
141+
<q-date :options="date => date >= new Date().toJSON().slice(0, 10).replace(/-/g, '/')" v-model="task.due_date" @input="() => $refs.due_date.hide()"/>
137142
</q-popup-proxy>
138143
</q-icon>
139144
</template>
@@ -145,8 +150,13 @@
145150
>
146151
<template v-slot:append>
147152
<q-icon name="access_time" class="cursor-pointer">
148-
<q-popup-proxy transition-show="scale" transition-hide="scale">
149-
<q-time v-model="task.due_time"/>
153+
<q-popup-proxy transition-show="scale" transition-hide="scale" >
154+
<q-time v-model="task.due_time">
155+
<div class="row items-center justify-end q-gutter-sm">
156+
<q-btn label="Cancel" color="primary" flat v-close-popup/>
157+
<q-btn label="OK" color="primary" flat @click="save" v-close-popup/>
158+
</div>
159+
</q-time>
150160
</q-popup-proxy>
151161
</q-icon>
152162
</template>
@@ -164,7 +174,7 @@
164174
</q-card>
165175
</q-dialog>
166176
<!-- End Add Task Dialog Box-->
167-
</q-page>
177+
</div> </q-page>
168178
</template>
169179

170180
<script>
@@ -177,13 +187,37 @@
177187
task: {selected: false},
178188
task_details: [],
179189
isUpdated: false,
180-
filter: ''
190+
filter: '',
191+
thumbStyle: {
192+
right: '4px',
193+
borderRadius: '5px',
194+
backgroundColor: '#027be3',
195+
width: '5px',
196+
opacity: 0.75
197+
},
198+
199+
barStyle: {
200+
right: '2px',
201+
borderRadius: '9px',
202+
backgroundColor: '#027be3',
203+
width: '9px',
204+
opacity: 0.2
205+
}
181206
}
182207
},
183208
methods: {
209+
currentDate() {
210+
211+
let formatted_date = new Date().toJSON().slice(0, 10).replace(/-/g, '/');
212+
return formatted_date
213+
214+
},
184215
openAddTaskDialogBox() {
185216
this.addTaskDialogBox = true
186217
},
218+
save() {
219+
this.time = this.task
220+
},
187221
saveTask() {
188222
this.$refs.name.validate()
189223
this.$refs.date.validate()
@@ -218,7 +252,7 @@
218252
}).onOk(() => {
219253
let index = this.task_details.indexOf(row)
220254
if (index !== -1) {
221-
this.task_details.splice(index, 1)
255+
this.task_details.splice(index, 1);
222256
}
223257
})
224258
},
@@ -246,7 +280,7 @@
246280
},
247281
filters: {
248282
niceDate(value) {
249-
return date.formatDate(value, 'MMM D')
283+
return date.formatDate(value, 'MMM D YYYY')
250284
}
251285
},
252286
computed: {
@@ -267,7 +301,7 @@
267301
})
268302
return temp_search
269303
}
270-
}
304+
},
271305
}
272306
</script>
273307

@@ -316,4 +350,8 @@
316350
border-color: orange
317351
}
318352
}
353+
.q-scroll-area-task{
354+
display: flex;
355+
flex-grow: 1;
356+
}
319357
</style>

0 commit comments

Comments
 (0)