i have completed the code with proper testing and hope that you accept it, please check your PMB for the screenshot of the results... if you add date
in comparison with current date
2011-07-02,2011-09-02 - result 100%
2011-07-02,2012-09-02 - result 100%
2011-07-02,2013-09-02 - result 69%