<?php class Redux_Validation_date extends ReduxFramework {	
	
	/**
	 * Field Constructor.
	 *
	 * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
	 *
	 * @since ReduxFramework 1.0.0
	*/
	function __construct($field, $value, $current) {
		
		parent::__construct();
		$this->field = $field;&#13;
		$this-&gt;field['msg'] = (isset($this-&gt;field['msg']))?$this-&gt;field['msg']:__('This field must be a valid date.', 'redux');&#13;
		$this-&gt;value = $value;&#13;
		$this-&gt;current = $current;&#13;
		//$this-&gt;validate();&#13;
		&#13;
	}//function&#13;
	&#13;
	&#13;
	&#13;
	/**&#13;
	 * Field Render Function.&#13;
	 *&#13;
	 * Takes the vars and outputs the HTML for the field in the settings&#13;
	 *&#13;
	 * @since ReduxFramework 1.0.0&#13;
	*/&#13;
	function validate() {&#13;
		&#13;
		$string = str_replace('/', '', $this-&gt;value);&#13;
		&#13;
		if(!is_numeric($string)){&#13;
			$this-&gt;value = (isset($this-&gt;current))?$this-&gt;current:'';&#13;
			$this-&gt;error = $this-&gt;field;&#13;
			return;&#13;
		}&#13;
		&#13;
		if($this-&gt;value[2] != '/'){&#13;
			$this-&gt;value = (isset($this-&gt;current))?$this-&gt;current:'';&#13;
			$this-&gt;error = $this-&gt;field;&#13;
			return;&#13;
		}&#13;
		&#13;
		if($this-&gt;value[5] != '/'){&#13;
			$this-&gt;value = (isset($this-&gt;current))?$this-&gt;current:'';&#13;
			$this-&gt;error = $this-&gt;field;&#13;
		}&#13;
		&#13;
		&#13;
	}//function&#13;
	&#13;
}//class