first commit
This commit is contained in:
26
templates/instytut_dendrologii_/js/mod29.js
Normal file
26
templates/instytut_dendrologii_/js/mod29.js
Normal file
@@ -0,0 +1,26 @@
|
||||
window.addEventListener('load', () => {
|
||||
setDateInput();
|
||||
})
|
||||
|
||||
function setDateInput(){
|
||||
document.querySelector('.arboretum-kontakt .date').setAttribute('type','date');
|
||||
document.querySelector('.arboretum-kontakt .date').setAttribute('min',formatDate());
|
||||
document.querySelector('.arboretum-kontakt .date').value=formatDate();
|
||||
document.querySelector('.arboretum-kontakt .hour').value='7.30 - 15.30';
|
||||
console.log(formatDate());
|
||||
}
|
||||
|
||||
function formatDate() {
|
||||
date = new Date();
|
||||
var d = new Date(date.setDate(date.getDate() + 5)),
|
||||
month = '' + (d.getMonth() + 1),
|
||||
day = '' + d.getDate(),
|
||||
year = d.getFullYear();
|
||||
|
||||
if (month.length < 2)
|
||||
month = '0' + month;
|
||||
if (day.length < 2)
|
||||
day = '0' + day;
|
||||
|
||||
return [year, month, day].join('-');
|
||||
}
|
||||
Reference in New Issue
Block a user