javascript - set dijit/form/TimeTextbox programmatically -
i'm not able set value of dijit/form/timetextbox date returned database or string -- i'm using dojo version 1.10.4
widget:
<input type="text" data-dojo-type="dijit/form/timetextbox" data-dojo-attach-point="tbmtgtime" value="t15:00:00" trying string:
this.tbmtgtime.set("value", "10:30 am");//doesnt work trying value sqlserver database:
var mtgdate = new date(parseint(mi.onsitemeetingdateint) * 1000); mtgdate.settime(mtgdate.gettime() + mtgdate.gettimezoneoffset() * 60 * 1000); this.tbmtgdate.set("value", mtgdate); var mtgtime = ddl.format(mtgdate, { selector: "time", timepattern: 'hh:mm a' }); this.tbmtgtime.set("value", mtgdate);//mtgdate 10:30 thanks
your string example won't work because it's not in thh:mm format timetextbox expects handle (as opposed value in declarative widget markup, in correct format). reference guide explains string format timetextbox widget directly supports.
passing date when setting value programmatically supported, , pick hour , minute passed date object, ostensibly first part of second example should work, presuming date valid. (i think latter part of second example intended call set('value', mtgtime), won't work reason explained above.)