I'm trying to find how many days are left in a school year and return it as a jQuery UI progressbar.
jQuery UI progressbars only take percentages. How can I find the percentage of how far along I am in the timespan between two supplied dates, given today's date?
The easiest way (algorithmically - you can figure out the code as an exercise) is to:
Example: http://jsfiddle.net/FLaJM/4/
or if you wanted the percentage remaining:
Example: http://jsfiddle.net/FLaJM/3/
If you are using MomentJS, which I highly recommend for Javascript date stuff, you could do this:
jsFiddle to see it in action...