case 4504
This commit is contained in:
@@ -236,23 +236,25 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item @click="subExpireAddOneWeek">
|
||||
<!-- <v-list-item @click="subExpireAddOneWeek">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$sockiPlus</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>One week</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list-item> -->
|
||||
<v-list-item @click="subExpireAddOneMonth">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$sockiPlus</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>One month</v-list-item-title>
|
||||
<v-list-item-title
|
||||
>One month + 7d</v-list-item-title
|
||||
>
|
||||
</v-list-item>
|
||||
<v-list-item @click="subExpireAddOneYear">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$sockiPlus</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>One year</v-list-item-title>
|
||||
<v-list-item-title>One year + 7d</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -633,30 +635,36 @@ export default {
|
||||
}
|
||||
},
|
||||
subExpireAddOneWeek: function() {
|
||||
// // eslint-disable-next-line
|
||||
// debugger;
|
||||
const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
this.obj.items[
|
||||
this.editItemIndex
|
||||
].expireDate = window.$gz.locale.addDurationToUTC8601String(now, {
|
||||
days: 7
|
||||
});
|
||||
this.obj.items[this.editItemIndex].expireDate = addToDate(
|
||||
this.obj.items[this.editItemIndex].expireDate,
|
||||
{
|
||||
days: 7
|
||||
}
|
||||
);
|
||||
},
|
||||
subExpireAddOneMonth: function() {
|
||||
const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
this.obj.items[
|
||||
this.editItemIndex
|
||||
].expireDate = window.$gz.locale.addDurationToUTC8601String(now, {
|
||||
months: 1
|
||||
});
|
||||
this.obj.items[this.editItemIndex].expireDate = addToDate(
|
||||
this.obj.items[this.editItemIndex].expireDate,
|
||||
{
|
||||
months: 1,
|
||||
days: 7
|
||||
}
|
||||
);
|
||||
},
|
||||
subExpireAddOneYear: function() {
|
||||
const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
this.obj.items[
|
||||
this.editItemIndex
|
||||
].expireDate = window.$gz.locale.addDurationToUTC8601String(now, {
|
||||
years: 1
|
||||
});
|
||||
this.obj.items[this.editItemIndex].expireDate = addToDate(
|
||||
this.obj.items[this.editItemIndex].expireDate,
|
||||
{
|
||||
years: 1,
|
||||
days: 7
|
||||
}
|
||||
);
|
||||
// const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
// this.obj.items[
|
||||
// this.editItemIndex
|
||||
// ].expireDate = window.$gz.locale.addDurationToUTC8601String(now, {
|
||||
// years: 1
|
||||
// });
|
||||
},
|
||||
canSave: function() {
|
||||
return this.formState.valid && this.formState.dirty;
|
||||
@@ -999,4 +1007,20 @@ async function populateSelectionLists(vm) {
|
||||
await window.$gz.enums.fetchEnumList("productgroup");
|
||||
vm.selectLists.pGroups = window.$gz.enums.getSelectionList("productgroup");
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
//
|
||||
//
|
||||
function addToDate(dateValue, span) {
|
||||
var newDate = dateValue;
|
||||
if (newDate == null) {
|
||||
newDate = window.$gz.locale.addDurationToUTC8601String(
|
||||
window.$gz.locale.nowUTC8601String(),
|
||||
span
|
||||
);
|
||||
} else {
|
||||
newDate = window.$gz.locale.addDurationToUTC8601String(newDate, span);
|
||||
}
|
||||
return newDate;
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user