Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-19192] Android 5.0.X: Fix for event fired #7094

Merged
merged 1 commit into from Aug 31, 2015

Conversation

ashcoding
Copy link
Contributor

Fix for event being fired twice. This fixes it by checking that the date
is changed before firing the event.

Jira reopened: https://jira.appcelerator.org/browse/TIMOB-19192

Fix for event being fired twice. This fixes it by checking that the date
is changed before firing the event.
@ashcoding
Copy link
Contributor Author

Tested with:

var vidWin = Titanium.UI.createWindow({
    title : 'Video View Demo',
    backgroundColor : '#000'
});

var picker = Ti.UI.createPicker({
    type:Ti.UI.PICKER_TYPE_DATE,
    minDate:new Date(2009,0,1),
    maxDate:new Date(2014,11,31),
    value:new Date(2014,3,12)
});
var button = Titanium.UI.createButton({
   title: 'Picker',
   top: 10,
   width: 100,
   height: 50
});
button.addEventListener('click',function(e)
{
    picker.showDatePickerDialog({
        value: new Date(2010,8,1),
        callback: function(e) {
            if (e.cancel) {
                alert('User canceled dialog');
            } else {
                alert('User selected date: ' + e.value);
            }
        }
    });
});

///


var picker2 = Ti.UI.createPicker({
    type:Ti.UI.PICKER_TYPE_DATE,
    minDate:new Date(2009,0,1),
    maxDate:new Date(2014,11,31),
    value:new Date(2014,3,12),
    top:120
});
picker2.addEventListener('change',function(e){


    alert("User selected date: " + e.value.toLocaleString());


});

var button2 = Titanium.UI.createButton({
   title: 'Picker',
   top: 60,
   width: 100,
   height: 50
});
button2.addEventListener('click',function(e)
{
     alert('picker2.value: ' + picker2.value);
});

vidWin.add(button);
vidWin.add(picker2);
vidWin.add(button2);
vidWin.open();

@ashcoding
Copy link
Contributor Author

Functionally tested. Accepted

ashcoding added a commit that referenced this pull request Aug 31, 2015
[TIMOB-19192] Android 5.0.X: Fix for event fired
@ashcoding ashcoding merged commit fbb0119 into tidev:master Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant