Answer the question
In order to leave comments, you need to log in
How to get the result of a JS function?
Calendar date picker function works
// Выбор даты
calendar.selectDate = function(day,month,year) {
calendar.selectedDate={
'Day' : day,
'Month' : month,
'Year' : year
};
calendar.drawCalendar(month,year);
}
document.getElementById('test_id').innerHTML='Hello World!';
Answer the question
In order to leave comments, you need to log in
Everything is simple, the second line from the bottom, just day+'-'+month+'-'+year
calendar.selectDate = function(day, month, year) {
calendar.selectedDate = {
'Day': day,
'Month': month,
'Year': year
};
calendar.drawCalendar(month, year);
document.getElementById('test_type').innerHTML = day+'-'+month+'-'+year;
}
calendar.selectDate = function(day,month,year) {
calendar.selectedDate={
'Day' : day,
'Month' : month,
'Year' : year
};
calendar.drawCalendar(month,year);
return this.selectedDate;//что вам мешает так сделать?
}
//можно получиться дату так
var date = calendar.selectDate(1,2,2015);
calendar.selectDate = function(day,month,year,callback) {
calendar.selectedDate={
'Day' : day,
'Month' : month,
'Year' : year
};
calendar.drawCalendar(month,year);
callback();
}
//вот как использовать
calendar.selectDate(1,2,2015,function(){document.getElementById('test_id').innerHTML='Hello World!';});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question