|
1 | 1 | <template>
|
2 |
| - <q-page padding> |
| 2 | + <q-page > |
| 3 | + <div class="q-pa-sm absolute full-width full-height column"> |
3 | 4 | <div class="typewriter text-center q-mb-lg q-mt-lg" v-if="$q.platform.is.desktop">
|
4 | 5 | <h1 class="text-bold">
|
5 | 6 | Todo Application
|
|
16 | 17 | <q-icon name="search"/>
|
17 | 18 | </template>
|
18 | 19 | </q-input>
|
| 20 | + |
19 | 21 | <q-banner class="bg-primary text-white" v-if="Object.keys(uncompletedTask).length == 0">
|
20 | 22 | No, Task to do Today !
|
21 | 23 | <template v-slot:action>
|
22 | 24 | <q-btn flat color="white" label="ADD TASK" @click="openAddTaskDialogBox"/>
|
23 | 25 |
|
24 | 26 | </template>
|
25 | 27 | </q-banner>
|
| 28 | +<q-scroll-area class="q-scroll-area-task" :thumb-style="thumbStyle" |
| 29 | + :bar-style="barStyle"> |
26 | 30 | <transition
|
27 | 31 | appear
|
28 | 32 | enter-active-class="animated zoomIn"
|
|
106 | 110 | </q-list>
|
107 | 111 | </div>
|
108 | 112 | </transition>
|
| 113 | +</q-scroll-area> |
109 | 114 |
|
110 | 115 |
|
111 |
| - <div class="absolute-bottom text-center q-mb-lg"> |
| 116 | + <div class="fixed-bottom text-center no-pointer-events" style="bottom: 45px" > |
112 | 117 | <!-- <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" /> |
115 | 120 | </q-fab>
|
116 | 121 |
|
117 | 122 | </div>
|
|
128 | 133 | ref="name" label="Task Name"/>
|
129 | 134 | </div>
|
130 | 135 | <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" |
132 | 137 | :rules="[val => !!val || 'Date is required']" label="Date">
|
133 | 138 | <template v-slot:append>
|
134 | 139 | <q-icon name="event" class="cursor-pointer">
|
135 | 140 | <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()"/> |
137 | 142 | </q-popup-proxy>
|
138 | 143 | </q-icon>
|
139 | 144 | </template>
|
|
145 | 150 | >
|
146 | 151 | <template v-slot:append>
|
147 | 152 | <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> |
150 | 160 | </q-popup-proxy>
|
151 | 161 | </q-icon>
|
152 | 162 | </template>
|
|
164 | 174 | </q-card>
|
165 | 175 | </q-dialog>
|
166 | 176 | <!-- End Add Task Dialog Box-->
|
167 |
| - </q-page> |
| 177 | + </div> </q-page> |
168 | 178 | </template>
|
169 | 179 |
|
170 | 180 | <script>
|
|
177 | 187 | task: {selected: false},
|
178 | 188 | task_details: [],
|
179 | 189 | 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 | + } |
181 | 206 | }
|
182 | 207 | },
|
183 | 208 | methods: {
|
| 209 | + currentDate() { |
| 210 | +
|
| 211 | + let formatted_date = new Date().toJSON().slice(0, 10).replace(/-/g, '/'); |
| 212 | + return formatted_date |
| 213 | +
|
| 214 | + }, |
184 | 215 | openAddTaskDialogBox() {
|
185 | 216 | this.addTaskDialogBox = true
|
186 | 217 | },
|
| 218 | + save() { |
| 219 | + this.time = this.task |
| 220 | + }, |
187 | 221 | saveTask() {
|
188 | 222 | this.$refs.name.validate()
|
189 | 223 | this.$refs.date.validate()
|
|
218 | 252 | }).onOk(() => {
|
219 | 253 | let index = this.task_details.indexOf(row)
|
220 | 254 | if (index !== -1) {
|
221 |
| - this.task_details.splice(index, 1) |
| 255 | + this.task_details.splice(index, 1); |
222 | 256 | }
|
223 | 257 | })
|
224 | 258 | },
|
|
246 | 280 | },
|
247 | 281 | filters: {
|
248 | 282 | niceDate(value) {
|
249 |
| - return date.formatDate(value, 'MMM D') |
| 283 | + return date.formatDate(value, 'MMM D YYYY') |
250 | 284 | }
|
251 | 285 | },
|
252 | 286 | computed: {
|
|
267 | 301 | })
|
268 | 302 | return temp_search
|
269 | 303 | }
|
270 |
| - } |
| 304 | + }, |
271 | 305 | }
|
272 | 306 | </script>
|
273 | 307 |
|
|
316 | 350 | border-color: orange
|
317 | 351 | }
|
318 | 352 | }
|
| 353 | + .q-scroll-area-task{ |
| 354 | + display: flex; |
| 355 | + flex-grow: 1; |
| 356 | + } |
319 | 357 | </style>
|
0 commit comments