Yii2: Compare an input that only enter dates with a specific format

0

How can I get an input in a date and if the date is not similar to this format aa-mm-yyyy do not accept it?

All that within a function "rules". I am using the following php code for the aa-mm-yyyy format but I have no idea how to continue

'^([0-2][0-9]|3[0-1])(\/|-)(0[1-9]|1[0-2])(\d{4})$'
    
asked by Oriol 30.01.2018 в 16:44
source

0 answers