문제

In the API here it says:

Trigger to set specified date

{'method'} === set

{'value'} === value to place in input

{'date'} === the date object being used

I want to set the datebox using my Date object variable "nowTime". But it just does not work. In other posts people usually set the datebox by value (which is a string) which is not quite neat at all. Is there any problem with my code? Or is it the datebox's bug?

My Code:

nowTime = new Date();
nowTime.setHours(8);
nowTime.setMinutes(50);
alert(nowTime.toLocaleString());
    
$("#departureTime").trigger('datebox', {'method':'set', 'date':nowTime}).trigger('datebox', {'method':'doset'});
도움이 되었습니까?

해결책

Works for me if you do the following:

$("#Date1").datebox('setTheDate', nowTime).trigger('datebox', {'method':'doset'});

DEMO

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top