Co-authored-by: Erik Kroes <erik.kroes@ing.com> Co-authored-by: Gerjan van Geest <gerjan.van.geest@ing.com> Co-authored-by: Thijs Louisse <thijs.louisse@ing.com> Co-authored-by: Thomas Allmer <thomas.allmer@ing.com>
12 lines
235 B
JavaScript
12 lines
235 B
JavaScript
/**
|
|
* Gives the last day of the previous month
|
|
*
|
|
* @param {Date} date
|
|
*
|
|
* returns {Date}
|
|
*/
|
|
export function getLastDayPreviousMonth(date) {
|
|
const previous = new Date(date);
|
|
previous.setDate(0);
|
|
return new Date(previous);
|
|
}
|