This commit is contained in:
2020-12-23 21:24:24 +00:00
parent 5caf2acb23
commit d114d7175b
6 changed files with 64 additions and 11 deletions

View File

@@ -6,19 +6,17 @@
MISC ITEMS THAT CAME UP
todo: data list view date filter
can't select EMPTY as one of the range choices, but it should be there, in fact should be there for any field
"No Value", "HasValue"
todo: datalists set default sort order as most appropriate in default list views
already done for review and report
todo: time picker no way to select NOW
todo: time picker defaults to 12:00am when date is selected, how about current time instead?
todo: date picker component add drop down quick pick:
i.e. Hour from now, Day from now, Week from now, Month from now.
todo: date and time defaults for appointments and shit
mainly what to do with stop date for example in reminder, can set start, how to set stop?
todo: datetime picker read only mode is grayed out, should not be?
probably still setting both readonly and disabled like old times
todo: Server returned broken rules not showing in form beside the field in Question
test on widget form to confirm
todo: incorrect creds on login get "res is not defined" instead of proper error

View File

@@ -188,6 +188,25 @@ export default {
.toString();
},
///////////////////////////////////////////////
// Get default start date time in api format
// (this is used to centralize and for future)
defaultStartDateTime(ofType) {
//ofType in future could be for
//different areas having different custom start / top times
//so will set that in all callers for future purposes, but
//for now, here going to ignore it and just default to now
//and now plus one hour
return {
start: window.$gz.DateTime.local()
.toUTC()
.toString(),
end: window.$gz.DateTime.local()
.plus({ hours: 1 })
.toUTC()
.toString()
};
},
///////////////////////////////////////////////
// Convert a utc date to local time zone
// and return date only portion only in iso 8601
// format (used by time and date picker components)

View File

@@ -33,7 +33,7 @@
</v-dialog>
</v-col>
<v-col xs6>
<v-dialog v-model="dlgtime" width="290px">
<v-dialog v-model="dlgtime" width="300px">
<template v-slot:activator="{ on }">
<v-text-field
v-on="on"
@@ -58,6 +58,10 @@
$ay.t("Delete")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="setNow()">{{
$ay.t("Now")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="dlgtime = false">{{
$ay.t("OK")
}}</v-btn>
@@ -119,6 +123,11 @@ export default {
}
},
methods: {
setNow() {
let v = window.$gz.locale.nowUTC8601String().split("T")[1];
this.updateTimeValue(v);
this.dlgtime = false;
},
allErrors() {
let ret = "";
if (this.error != null) {

View File

@@ -2,7 +2,7 @@
<v-row>
<template v-if="!readonly">
<v-col cols="12">
<v-dialog v-model="dlgtime" width="290px">
<v-dialog v-model="dlgtime" width="300px">
<template v-slot:activator="{ on }">
<v-text-field
v-on="on"
@@ -26,6 +26,10 @@
$ay.t("Delete")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="setNow()">{{
$ay.t("Now")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="dlgtime = false">{{
$ay.t("OK")
}}</v-btn>
@@ -88,6 +92,11 @@ export default {
}
},
methods: {
setNow() {
let v = window.$gz.locale.nowUTC8601String().split("T")[1];
this.updateTimeValue(v);
this.dlgtime = false;
},
allErrors() {
let ret = "";
if (this.error != null) {

View File

@@ -169,6 +169,15 @@ export default {
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
}
} else {
//----------------------------------------------------------
//NEW OBJECT DEFAULTS
let defaultDates = window.$gz.locale.defaultStartDateTime(
window.$gz.type.Reminder
);
vm.obj.startDate = defaultDates.start;
vm.obj.stopDate = defaultDates.end;
//----------------------------------------------------------
window.$gz.form.setFormState({
vm: vm,
loading: false
@@ -217,12 +226,13 @@ export default {
wiki: null,
customFields: "{}",
tags: [],
startDate: window.$gz.locale.nowUTC8601String(),
startDate: null,
stopDate: null,
userId: window.$gz.store.state.userId,
color: "#FFFFFFFF"
},
//mStartDate = new SmartDate(DBUtil.CurrentWorkingDateTime);//case 1967 set starting date so can't save with no date
//mStopDate = new SmartDate(DBUtil.CurrentWorkingDateTime.AddHours(1));//case 1967 starting default
tab: 0,
formState: {
ready: false,

View File

@@ -270,6 +270,14 @@ export default {
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
}
} else {
//----------------------------------------------------------
//NEW OBJECT DEFAULTS
let defaultDates = window.$gz.locale.defaultStartDateTime(
window.$gz.type.Widget
);
vm.obj.startDate = defaultDates.start;
vm.obj.endDate = defaultDates.end;
//----------------------------------------------------------
window.$gz.form.setFormState({
vm: vm,
loading: false