Skip to content

Instantly share code, notes, and snippets.

@nexeck
Created September 14, 2011 08:14
Show Gist options
  • Save nexeck/1216085 to your computer and use it in GitHub Desktop.
Save nexeck/1216085 to your computer and use it in GitHub Desktop.
Kohana Valid Date Less Than
/**
* Kleiner Als Methode
*
* @static
* @param $validation
* @param $field1
* @param $field2
* @param $field2_name string Wird für den Fehlertext benutzt, und sollte die Bezeichnung des Feld1 beinhalten
* @return bool
*/
public static function date_less_than($validation, $field1, $field2, $field2_name)
{
$date1 = new DateTime($validation[$field1]);
$date2 = new DateTime($validation[$field2]);
return ($date1 < $date2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment