protected function compileDate($key, $masque)
    {
        if (!preg_match("/^date?$/", $masque, $match)) {
            return;
        }

        if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $this->inputs[$key])) {
            return;
        }

        $this->fails = true;
        
        $this->last_message = $this->lexique('date', $key);
        
        $this->errors[$key][] = [
            "masque" => $masque,
            "message" => $this->last_message
        ];
    }
protected function compileDate($key, $masque)
    {
        if (!preg_match("/^date?$/", $masque, $match)) {
            return;
        }

        if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $this->inputs[$key])) {
            return;
        }

        $this->fails = true;
        
        $this->last_message = $this->lexique('date', $key);
        
        $this->errors[$key][] = [
            "masque" => $masque,
            "message" => $this->last_message
        ];
    }
protected function compileDate ( $ key , $ masque ) { if ( ! preg_match ( "/^date?$/" , $ masque , $ match ) ) { return ; } if ( ! preg_match ( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/' , $ this -> inputs [ $ key ] ) ) { return ; } $ this -> fails = true ; $ this -> last_message = $ this -> lexique ( 'date' , $ key ) ; $ this -> errors [ $ key ] [ ] = [ "masque" => $ masque , "message" => $ this -> last_message ] ; }
Compile Date Rule

[date] Check that the field's content is a valid date

@param string $key
@param string $masque

@return void
Compile Date Rule