I am familiar on how to find the difference of two dates given two moment object a and b:
let diffDays = a.diff(b, 'days');
What I am having a problem with is ignoring the year. I only want moment a and b to find the difference of days disregarding what year it is.
Example:
a = June 1, 2015
b = June 5, 1992 //desired outcome 4. Not 4 + 4*365
let diffDays = a.diff(b, 'days')
How would I go about this?
UPDATE
The scenario that breaks most answers is below:
let c = moment( "January 5, 2015" );
let d = moment( "December 25" ).year( c.year() );
console.log(Math.abs( c.diff( d, 'days' ) ));
Output: 354 Desired: 11
Setting the year to the same looks like it causes issues. Any solution?