php validation added

This commit is contained in:
Julie Lenaerts 2022-01-28 18:06:13 +01:00
parent fe4eaa92be
commit e2d406b97b
2 changed files with 3 additions and 6 deletions

View File

@ -212,6 +212,8 @@ class AccompanyingPeriod implements
*
* @ORM\Column(type="date")
* @Groups({"read", "write", "docgen:read"})
* @Assert\LessThan(value= "today", groups={AccompanyingPeriod::STEP_CONFIRMED})
* @Assert\LessThan(propertyPath="closingDate", groups={AccompanyingPeriod::STEP_CONFIRMED})
*/
private ?DateTime $openingDate = null;

View File

@ -25,7 +25,7 @@ export default {
methods: {
updateStartDate(event) {
const date = event.target.value;
console.log(date)
// console.log(date)
this.$store.dispatch('updateStartDate', date)
.catch(({name, violations}) => {
if (name === 'ValidationException' || name === 'AccessException') {
@ -37,11 +37,6 @@ export default {
},
},
computed: {
// startDate() {
// const date = ISOToDatetime(this.$store.state.accompanyingCourse.openingDate.datetime)
// console.log(dateToISO(date))
// // return datetimeToISO(this.$store.state.accompanyingCourse.openingDate)
// }
...mapState({
startDate: state => dateToISO(ISOToDatetime(state.accompanyingCourse.openingDate.datetime))
})