This commit is contained in:
@@ -72,6 +72,9 @@ export default {
|
||||
},
|
||||
formats: {
|
||||
decimalSeparator: ".",
|
||||
currencySymbol: "$"
|
||||
currencySymbol: "$",
|
||||
shortDateFormat: "YYYY-MM-DD",
|
||||
shortTimeFormat: "hh:mm:ss A",
|
||||
shortDateAndTimeFormat: "YYYY-MM-DD hh:mm:ss A"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,7 +41,13 @@
|
||||
</template> <script>
|
||||
export default {
|
||||
data: () => ({ date: null, modal: false, modal2: false }),
|
||||
props: { label: String, value: String, readonly: Boolean },
|
||||
props: {
|
||||
label: String,
|
||||
value: String,
|
||||
readonly: Boolean,
|
||||
dayjs: Function,
|
||||
locale: Object
|
||||
},
|
||||
watch: {
|
||||
date() {
|
||||
this.$emit("input", this.date);
|
||||
@@ -52,29 +58,18 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
formatDateTime() {
|
||||
return this.value.toString();
|
||||
// let momentObj = this.$moment.utc();
|
||||
// if (this.value) {
|
||||
// momentObj = this.$moment.utc(this.value);
|
||||
// }
|
||||
// return momentObj.local().format("dddd MM/DD/YYYY h:mm a");
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.shortDateAndTimeFormat)
|
||||
: "";
|
||||
},
|
||||
formatDate() {
|
||||
return this.value.toString();
|
||||
// let momentObj = this.$moment.utc();
|
||||
// if (this.value) {
|
||||
// momentObj = this.$moment.utc(this.value);
|
||||
// }
|
||||
// return momentObj.local().format("dddd MM/DD/YYYY");
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.shortTimeFormat)
|
||||
: "";
|
||||
},
|
||||
dateOnly: {
|
||||
get() {
|
||||
return this.value ? this.value.substr(0, 10) : null;
|
||||
// let momentObj = this.$moment.utc();
|
||||
// if (this.value) {
|
||||
// momentObj = this.$moment.utc(this.value);
|
||||
// }
|
||||
// return momentObj.local().format("YYYY-MM-DD");
|
||||
},
|
||||
set(value) {
|
||||
this.date = value + " " + this.timeOnly;
|
||||
@@ -94,7 +89,11 @@ export default {
|
||||
}
|
||||
},
|
||||
formatTime() {
|
||||
return this.value ? this.value.substr(11, 8) : null;
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.shortTimeFormat)
|
||||
: "";
|
||||
//Note in original code this would be parsed expecting source value to be in UTC format coming in but display in local time format
|
||||
//so
|
||||
// let momentObj = this.$moment.utc();
|
||||
// if (this.value) {
|
||||
// momentObj = this.$moment.utc(this.value);
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<gz-date-time-picker label="Start" v-model="obj.startDate"></gz-date-time-picker>
|
||||
<gz-date-time-picker label="Start" :dayjs="this.dayjsLib" :locale="this.lc" v-model="obj.startDate"></gz-date-time-picker>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
@@ -95,6 +95,7 @@ export default {
|
||||
return {
|
||||
obj: {},
|
||||
lc: locale,
|
||||
dayjsLib: dayjs,
|
||||
theDate: new Date(),
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
menu: false,
|
||||
|
||||
Reference in New Issue
Block a user