Copy from an older thread:
I wrote apps which need and do exact calculations of dates with adding and subtracting days and months. Never cared about setting to midnight.
There are several libraries which provide exact date calculations. It seems important to have a library which provides locales as well.
Currently I prefer to use moment.js. My extraheaders property e.g. would contain:
<link rel="stylesheet" href="ted/tempusdominus-bootstrap-4.min.css" type="text/css" />
<link rel="stylesheet" href="css/all.css" type="text/css" />
moment-with-locales.min.js enables to set the locale e.g. to “de_DE” which is done in datepicker settings.
tempusdominus provides a nice datepicker which works together with bootstrap 4.
Adding days and getting the precise new date would work like this:
datum2 = moment(datum1, "DD.MM.YYYY").add(vTageZahl, 'days').toDate();