This commit is contained in:
2019-06-06 22:41:46 +00:00
parent 12042a17c2
commit 13c8fe267d
2 changed files with 43 additions and 10 deletions

View File

@@ -57,7 +57,7 @@
/* eslint-disable */
export default {
beforeCreate() {
//debugger;
//check pre-requisites exist just in case
if (this.$gzdevmode()) {
if (!this.$dayjs) {
@@ -107,7 +107,6 @@ export default {
: "";
},
formatDate() {
return this.value
? this.$dayjs
.utc(this.value)
@@ -124,15 +123,24 @@ export default {
: "";
},
dateOnly: {
get() {
return this.$dayjs
.utc(this.value)
//debugger;
var defaultDateString = this.$dayjs()
.utc()
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format("YYYY-MM-DD");
return this.value
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format("YYYY-MM-DD")
: defaultDateString;
},
set(value) {
//debugger;
//TODO: This needs to handle a null / empty this.timeOnly here by maybe defaulting to right now
this.date = this.$dayjs
.utc(value + " " + this.timeOnly)
.subtract(this.$gzlocale.format().timeZoneOffset, "hour")
@@ -141,12 +149,22 @@ export default {
},
timeOnly: {
get() {
return this.$dayjs
.utc(this.value)
var defaultTimeString = this.$dayjs
.utc()
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format("HH:mm:ss");
return this.value
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format("HH:mm:ss")
: defaultTimeString;
},
set(value) {
//debugger;
//TODO: This needs to handle a null / empty this.dateOnly here by maybe defaulting to right now
this.date = this.$dayjs
.utc(this.dateOnly + " " + value)
.subtract(this.$gzlocale.format().timeZoneOffset, "hour")

View File

@@ -342,8 +342,7 @@ export default {
{"data":{"id":100,"concurrencyToken":2197,"name":"Handmade Cotton Chair 122","serial":100,"dollarAmount":811.47000,"active":true,"roles":8212,
"startDate":"2019-06-06T08:48:13.059631Z","endDate":"2019-06-06T12:38:30.654906Z",
"notes":"Minima qui assumenda.","count":0,"customFields":null,"tags":["indigo","brown","silver","gold"]}}
*/
obj: {
{
id: 0,
concurrencyToken: 0,
name: "",
@@ -357,6 +356,22 @@ export default {
count: 0,
customFields: [],
tags: []
}
*/
obj: {
id: 0,
concurrencyToken: 0,
name: null,
serial: null,
dollarAmount: null,
active: null,
roles: null,
startDate: null,
endDate: null,
notes: null,
count: null,
customFields: null,
tags: null
},
formState: {
ready: false,