I have this string:
16.12.2018
Then I create an object from it and add one day, like this:
var mindate = new Date(mindate.split('.').reverse().join(','));
if (mindate.getDay() == 0) { // If it is Friday
mindate.setDate(mindate.getDate() + 1);
}
The result is: Mon Dec 17 2018 00:00:00 GMT+0200 (Eastern European Standard Time)
Is it possible to return same string from new Date, aka 17.12.2018, without using additional libraries?
.toLocaleDateString( someLocale ). Else you better off with writing your own formatting function as shown below and in the duplicates, since it'll be easier to work with than trying to force one of the toString functions to respect the format you want through their options.