mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Address: fetch POST valid dates when applying changes from datePane
This commit is contained in:
@@ -299,14 +299,16 @@ export default {
|
||||
return (typeof this.options.openPanesInModal !== 'undefined') ?
|
||||
this.options.openPanesInModal : this.defaultz.openPanesInModal;
|
||||
},
|
||||
useDatePane() {
|
||||
let vFrom = (typeof this.options.useDate !== 'undefined'
|
||||
&& typeof this.options.useDate.validFrom !== 'undefined') ?
|
||||
this.options.useDate.validFrom : this.defaultz.useDate.validFrom ;
|
||||
let vTo = (typeof this.options.useDate !== 'undefined'
|
||||
&& typeof this.options.useDate.validTo !== 'undefined') ?
|
||||
validFrom() {
|
||||
return (typeof this.options.useDate !== 'undefined' && typeof this.options.useDate.validFrom !== 'undefined') ?
|
||||
this.options.useDate.validFrom : this.defaultz.useDate.validFrom;
|
||||
},
|
||||
validTo() {
|
||||
return (typeof this.options.useDate !== 'undefined' && typeof this.options.useDate.validTo !== 'undefined') ?
|
||||
this.options.useDate.validTo : this.defaultz.useDate.validTo ;
|
||||
return (vFrom || vTo) ? true : false;
|
||||
},
|
||||
useDatePane() {
|
||||
return (this.validFrom || this.validTo) ? true : false;
|
||||
},
|
||||
hasSuggestions() {
|
||||
// TODO
|
||||
@@ -335,6 +337,8 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
|
||||
console.log('validFrom', this.validFrom);
|
||||
console.log('validTo', this.validTo);
|
||||
console.log('useDatePane', this.useDatePane);
|
||||
|
||||
console.log('Mounted now !');
|
||||
@@ -566,6 +570,22 @@ export default {
|
||||
'point': this.entity.selected.address.point.coordinates
|
||||
});
|
||||
}
|
||||
if (this.validFrom) {
|
||||
console.log('add validFrom in fetch body', this.entity.selected.valid.from);
|
||||
newAddress = Object.assign(newAddress, {
|
||||
'validFrom': {
|
||||
datetime: `${this.entity.selected.valid.from.toISOString().split('T')[0]}T00:00:00+0100`
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.validTo && null !== this.entity.selected.valid.to) {
|
||||
console.log('add validTo in fetch body', this.entity.selected.valid.to);
|
||||
newAddress = Object.assign(newAddress, {
|
||||
'validTo': {
|
||||
datetime: `${this.entity.selected.valid.to.toISOString().split('T')[0]}T00:00:00+0100`
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.entity.selected.writeNew.postcode) {
|
||||
let newPostcode = this.entity.selected.postcode;
|
||||
newPostcode = Object.assign(newPostcode, {
|
||||
|
Reference in New Issue
Block a user