finished function to guess the users food plan

Check this out to make sure it won't break anything.  It works with the sample as far as I can tell.  You could get a better prediction by using the difference between the current and the target and adding that to the plan prediction.  Going back to try that now.
The moment library (which is already included) has a lot of useful methods for doing this kind of date math:
Check it out:
http://momentjs.com/docs/