Address datePane: validTo date display and format

This commit is contained in:
Mathieu Jaumotte 2021-09-22 17:20:31 +02:00
parent d994612987
commit a8024ba38f
3 changed files with 26 additions and 22 deletions

View File

@ -280,7 +280,7 @@ export default {
},
valid: {
from: new Date(),
to: new Date()
to: null
}
},
addressMap: {
@ -609,8 +609,10 @@ export default {
if (this.context.target.name === 'person') { // !!! maintain here ?
postcodeBody = Object.assign(postcodeBody, {'origin': 3});
}
console.log('juste before post new postcode', postcodeBody);
return postPostalCode(postcodeBody)
.then(postalCode => {
console.log('new postcode created', postalCode.id);
payload.postcode = {'id': postalCode.id };
return this.postNewAddress(payload);
});

View File

@ -11,7 +11,8 @@
<address-render-box :address="address"></address-render-box>
<div v-if="showDateFrom" class='address-valid date-since'>
<div class="row">
<div v-if="showDateFrom" class='col-lg-6 address-valid date-since'>
<h3>{{ $t(getValidFromDateText) }}</h3>
<div class="input-group mb-3">
<span class="input-group-text" id="validFrom"><i class="fa fa-fw fa-calendar"></i></span>
@ -23,7 +24,7 @@
</div>
</div>
<div v-if="showDateTo" class='address-valid date-until'>
<div v-if="showDateTo" class='col-lg-6 address-valid date-until'>
<h3>{{ $t(getValidToDateText) }}</h3>
<div class="input-group mb-3">
<span class="input-group-text" id="validTo"><i class="fa fa-fw fa-calendar"></i></span>
@ -34,6 +35,7 @@
/>
</div>
</div>
</div>
<action-buttons v-if="insideModal === false"
:options="this.options"
@ -88,7 +90,7 @@ export default {
this.entity.selected.valid.to = ISOToDate(value);
},
get() {
return dateToISO(this.entity.selected.valid.from);
return dateToISO(this.entity.selected.valid.to);
}
},
getValidFromDateText() {

View File

@ -30,11 +30,11 @@
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
targetEntity: { name: 'person', id: person.id },
stickyActions: true,
useValidFrom: true, useValidTo: true,
} %}
{#
backUrl: path('chill_person_address_list', { 'person_id': person.id }),
openPanesInModal: false,
useValidFrom: true,
#}
{% endblock %}