Skip to content

Instantly share code, notes, and snippets.

@MotiurRahman
Created September 5, 2015 07:24
Show Gist options
  • Save MotiurRahman/4abea318254ac0110dcc to your computer and use it in GitHub Desktop.
Save MotiurRahman/4abea318254ac0110dcc to your computer and use it in GitHub Desktop.
Date Picker using showDatePickerDialog() (Android only)
var picker = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
top : 50
});
$.txt.addEventListener('click', function(e) {
picker.showDatePickerDialog({
callback : function(e) {
if (e.cancel) {
Ti.API.info('User canceled dialog');
} else {
$.txt.value = (e.value.toLocaleString());
}
}
});
});
$.index.open();
<Alloy>
<Window>
<TextField id="txt" top="20" width="200" height="60"></TextField>
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment