var today = new Date();
var tomorrow = new Date(today.getTime() + (24 * 60 * 60 * 1000));
var dayTomorrow = tomorrow.getDate();
var monthTomorrow = tomorrow.getMonth() + 1;
var yearTomorrow = tomorrow.getFullYear();
$('#datepicker').attr('placeholder', `Завтра ${dayTomorrow}.${monthTomorrow}.${ yearTomorrow}`);
const today = new Date();
const tomorrow = new Date(today.getTime() + (24 * 60 * 60 * 1000));
const formatter = new Intl.DateTimeFormat(navigator.language, {
year: '2-digit',
month: '2-digit',
day: '2-digit'
});
$('#datepicker').attr('placeholder', `Завтра ${formatter.format(tomorrow)}`);
navigator.language
можно использовать 'ru-RU'
. function showDate() {
let today = new Date();
let tomorrow = new Date(today.getTime() + (24 * 60 * 60 * 1000));
let date = tomorrow.getDate();
let month = tomorrow.getMonth() + 1;
let year = tomorrow.getFullYear();
return getFullDate(date) + '.' + getFullDate(month) + '.' + getFullDate(year);
}
function getFullDate(date) {
if(date < 10) {
date = '0' + date;
} else if(date > 2000) {
date = date - 2000;
} else {
date = date;
};
return date;
};
let newDate = showDate();
console.log(newDate);