I want to get list of month names between two dates
Date1 : 1/1/2016
Date2 : 1/4/2017
Result should be :
January 2016
February 2016
March 2016
April 2016 To April 2017
I want to get list of month names between two dates
Date1 : 1/1/2016
Date2 : 1/4/2017
Result should be :
January 2016
February 2016
March 2016
April 2016 To April 2017
Making the 'Krunal' answer a little more clean:
This is a solution with the method
enumerateDates(startingAfter:matching:matchingPolicy:)
ofCalendar
to enumerate dates very efficiently based onDateComponents
Use below code to get a list of years between two dates.