Update validation for birthday
	
		
			
	
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
					Details
				
			
		
	
				
					
				
			
				
	
				continuous-integration/drone/push Build is passing
				
					Details
				
			
		
	This commit is contained in:
		
							parent
							
								
									852d69d983
								
							
						
					
					
						commit
						969f197347
					
				| 
						 | 
					@ -66,7 +66,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div x-show="isUnder18" class="col-span-full text-sm items-center p-4 border-2 rounded-lg form-group shadow-sm group bg-red-950 border-red-900">
 | 
					        <div x-show="isUnder18" class="col-span-full text-sm items-center p-4 border-2 rounded-lg form-group shadow-sm group bg-red-950 border-red-900">
 | 
				
			||||||
            <div class="text-red-200">
 | 
					            <div class="text-red-200">
 | 
				
			||||||
                <span class="font-bold">Bitte beachte:</span> Bei Veranstaltungen mit nicht volljährigen Veranstaltern (z.B. 18. Geburtstag) muss eine Person über 35 Jahre (z.B. Erziehungsberechtigte*r) durchgehend anwesend sein.
 | 
					                <span class="font-bold">Bitte beachte:</span> Bei Veranstaltungen mit nicht volljährigen Veranstaltern (z.B. 18. Geburtstag) muss eine Person über 25 Jahre (z.B. Erziehungsberechtigte*r) durchgehend anwesend sein.
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="{{maingrid}}">
 | 
					            <div class="{{maingrid}}">
 | 
				
			||||||
                <div>
 | 
					                <div>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,11 +52,11 @@ Alpine.data('form', () => ({
 | 
				
			||||||
        datenschutz: false,
 | 
					        datenschutz: false,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    isUnder18: function () {
 | 
					    isUnder18: function () {
 | 
				
			||||||
        if (!this.value.birthday || !this.value.date) {
 | 
					        if (!this.value.birthday) {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return dayjs(this.value.birthday, 'DD.MM.YYYY').add(18, 'year').isAfter(dayjs(this.value.date, 'DD.MM.YYYY'));
 | 
					        return dayjs(this.value.birthday, 'DD.MM.YYYY').add(18, 'year').isAfter(dayjs());
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    onChangeDate: async function (n) {
 | 
					    onChangeDate: async function (n) {
 | 
				
			||||||
        const date = dayjs(this.value.date, 'DD.MM.YYYY');
 | 
					        const date = dayjs(this.value.date, 'DD.MM.YYYY');
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue