I am trying to have a window pop up and utilize the time part of the picker this is my code and when it executes it shows the date and not the time.
var dpwin3 = Ti.UI.createWindow({ exitOnClose : true, backgroundColor:'black', layout : 'vertical' }); var timepicker = Ti.UI.createPicker({ type : Ti.UI.PICKER_TYPE_TIME, minuteInterval: 5, value : defaultResvTime }); dpwin3.open();
2 Answers
var dpwin3 = Ti.UI.createWindow({ exitOnClose : true, backgroundColor : 'black', layout : 'vertical' }); var timepicker = Ti.UI.createPicker({ type : Ti.UI.PICKER_TYPE_TIME, minuteInterval : 5, }); dpwin3.add(timepicker); dpwin3.open();This code works perfectly? So where is the issue?
Here is the actual code.
var defresvtimeChange = Ti.UI.createButton({ title:'Change',font:{fontWeight:'bold'}, backgroundColor:'blue',color:'white', top:280, left:340, width:'auto', height:40 }); defresvtimeChange.addEventListener('click',function(e){ var dpwin3 = Ti.UI.createWindow({ exitOnClose : true, backgroundColor:'black', layout : 'vertical' }); var timepicker = Ti.UI.createPicker({ type : Ti.UI.PICKER_TYPE_TIME, minuteInterval: 5, value : defaultResvTime }); dpwin3.open(); timepicker.showTimePickerDialog({ value : defaultResvTime, callback : function(e) { if (e.cancel) { Ti.API.info('User canceled dialog'); } else { imtrsettingspage_label3ans.text = formatTime(e.value); defaultResvTime=e.value; } dpwin3.close(); } }); }); imtrsettingspage.add(defresvtimeChange);
Your Answer
Think you can help? Login to answer this question!