Get years between two dates in jQuery -


i need years between 2 dates in jquery
example if have these 2 dates ("2014-5-1" , "2017-4-6"), need of years between them (2014, 2015, 2016, 2017)
can 1 me please
in advance

something return array years

function getyears(from, to) {     var d1 = new date(from),         d2 = new date(to),         yr = [];      (var i=d1.getfullyear(); i<=d2.getfullyear(); i++) {         yr.push( );     }      return yr; } 

fiddle


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -