Created
June 18, 2014 16:53
-
-
Save koloda/16aa2730067da321e01a to your computer and use it in GitHub Desktop.
Validate georgian date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function validGeorgianDate($attribute, $params) | |
{ | |
$parts = explode('/', $this->$attribute); | |
if(count($parts) == 3) | |
if(is_numeric($parts[0]) && is_numeric($parts[1]) && is_numeric($parts[2])) | |
if (checkdate($parts[0], $parts[1], $parts[2])) | |
return; | |
$this->addError($attribute, "Value is nod valid date."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment