-2
Good afternoon, you guys! I need a function that I enter a date and it returns me the date of the last four months, can be done in Angularjs or javascript, can give me some help with this?
I want to take the last four months/year of a date for example
"Fri Sep 22 2017 14:42:35 GMT-0300"
and the output example
"Fri Sep 22 2017 14:42:35 GMT-0300",
"Fri Out 22 2017 14:42:35 GMT-0300",
"Fri Nov 22 2017 14:42:35 GMT-0300",
"Fri Dez 22 2017 14:42:35 GMT-0300"
Ok, but the solutions given do not predict this problem and if you pass a date when the day is 31 you will get a wrong result. So make sure you don’t wear any days over 28. just test with 'Tue Oct 31 2017 14:42:35 GMT-0300' q vc see q, although the month given to be October, it returns the month preceding as October again.
– CCastro