mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Address datePane: validTo date display and format
This commit is contained in:
parent
d994612987
commit
a8024ba38f
@ -280,7 +280,7 @@ export default {
|
|||||||
},
|
},
|
||||||
valid: {
|
valid: {
|
||||||
from: new Date(),
|
from: new Date(),
|
||||||
to: new Date()
|
to: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addressMap: {
|
addressMap: {
|
||||||
@ -609,8 +609,10 @@ export default {
|
|||||||
if (this.context.target.name === 'person') { // !!! maintain here ?
|
if (this.context.target.name === 'person') { // !!! maintain here ?
|
||||||
postcodeBody = Object.assign(postcodeBody, {'origin': 3});
|
postcodeBody = Object.assign(postcodeBody, {'origin': 3});
|
||||||
}
|
}
|
||||||
|
console.log('juste before post new postcode', postcodeBody);
|
||||||
return postPostalCode(postcodeBody)
|
return postPostalCode(postcodeBody)
|
||||||
.then(postalCode => {
|
.then(postalCode => {
|
||||||
|
console.log('new postcode created', postalCode.id);
|
||||||
payload.postcode = {'id': postalCode.id };
|
payload.postcode = {'id': postalCode.id };
|
||||||
return this.postNewAddress(payload);
|
return this.postNewAddress(payload);
|
||||||
});
|
});
|
||||||
|
@ -11,27 +11,29 @@
|
|||||||
|
|
||||||
<address-render-box :address="address"></address-render-box>
|
<address-render-box :address="address"></address-render-box>
|
||||||
|
|
||||||
<div v-if="showDateFrom" class='address-valid date-since'>
|
<div class="row">
|
||||||
<h3>{{ $t(getValidFromDateText) }}</h3>
|
<div v-if="showDateFrom" class='col-lg-6 address-valid date-since'>
|
||||||
<div class="input-group mb-3">
|
<h3>{{ $t(getValidFromDateText) }}</h3>
|
||||||
<span class="input-group-text" id="validFrom"><i class="fa fa-fw fa-calendar"></i></span>
|
<div class="input-group mb-3">
|
||||||
<input type="date" class="form-control form-control-lg" name="validFrom"
|
<span class="input-group-text" id="validFrom"><i class="fa fa-fw fa-calendar"></i></span>
|
||||||
v-bind:placeholder="$t(getValidFromDateText)"
|
<input type="date" class="form-control form-control-lg" name="validFrom"
|
||||||
v-model="validFrom"
|
v-bind:placeholder="$t(getValidFromDateText)"
|
||||||
aria-describedby="validFrom"
|
v-model="validFrom"
|
||||||
/>
|
aria-describedby="validFrom"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</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>
|
<h3>{{ $t(getValidToDateText) }}</h3>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-text" id="validTo"><i class="fa fa-fw fa-calendar"></i></span>
|
<span class="input-group-text" id="validTo"><i class="fa fa-fw fa-calendar"></i></span>
|
||||||
<input type="date" class="form-control form-control-lg" name="validTo"
|
<input type="date" class="form-control form-control-lg" name="validTo"
|
||||||
v-bind:placeholder="$t(getValidToDateText)"
|
v-bind:placeholder="$t(getValidToDateText)"
|
||||||
v-model="validTo"
|
v-model="validTo"
|
||||||
aria-describedby="validTo"
|
aria-describedby="validTo"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -88,7 +90,7 @@ export default {
|
|||||||
this.entity.selected.valid.to = ISOToDate(value);
|
this.entity.selected.valid.to = ISOToDate(value);
|
||||||
},
|
},
|
||||||
get() {
|
get() {
|
||||||
return dateToISO(this.entity.selected.valid.from);
|
return dateToISO(this.entity.selected.valid.to);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getValidFromDateText() {
|
getValidFromDateText() {
|
||||||
|
@ -30,11 +30,11 @@
|
|||||||
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
|
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
|
||||||
targetEntity: { name: 'person', id: person.id },
|
targetEntity: { name: 'person', id: person.id },
|
||||||
stickyActions: true,
|
stickyActions: true,
|
||||||
|
useValidFrom: true, useValidTo: true,
|
||||||
} %}
|
} %}
|
||||||
{#
|
{#
|
||||||
backUrl: path('chill_person_address_list', { 'person_id': person.id }),
|
backUrl: path('chill_person_address_list', { 'person_id': person.id }),
|
||||||
openPanesInModal: false,
|
openPanesInModal: false,
|
||||||
useValidFrom: true,
|
|
||||||
#}
|
#}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user