Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Learn How To Use JavaScript Dates and Leap Years

Share this post!
 Vote this!

Think that you can calculate date intervals without worrying about leap years? Think again. It's true that, as long as you follow the guidelines set out in my previous Calculating the Difference between Two Dates article, the leap years will be accounted for and handled correctly. But this presumes that you aren't interested in any particulars about the leap years themselves.

If you ever find yourself trying to calculate any kind of annualized figures, you'll soon realize that it can pay off to know how to separate leap years from non-leap years. This article will introduce a few useful functions that you can use to work with leap years if and when the need arises.

And by the way, this is leading up to something pretty useful in the next article, where we will implement a JavaScript annualized returns calculator which will feature the HTML5 Date Picker element with a jQuery widget fallback.

More...

0 comments:

Post a Comment