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
fix(android): fix setting DatePicker's minDate\maxDate #11369
Conversation
Fix for setting min\max Date for Date type of Ti.UI.Picker. Some code omptimization. Adding getters for the properties.
Tests:
|
I believe the |
@Kroll.getProperty | ||
public Date getValue() | ||
{ | ||
if (type == UIModule.PICKER_TYPE_DATE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't account for Time pickers. I know Android doesn't support Date + Time pickers for now, but for a Time picker, I think this should likely return the Date object equivalent to "today" at the selected time of the picker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, not the point of this PR, but why don't we have a Date + Time picker on Android? I mean we support each individually. Why can't we just create a component that includes both (and merges the date and time value into a single Date object?). Maybe this is a good job to do at the JS level, overriding the createPicker method to handle that specific case and have it silently delegate to both pickers under the hood?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should our own custom Date+Time picker.
I've written a feature request for it here: TIMOB-27840
|
||
describe('Titanium.UI.Picker', function () { | ||
|
||
var win; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to "clean up" (close) the window after the test like the other UI test suites do.
Related, the |
@sgtcoolguy, I don't think we should remove the "useSpinner" feature and perhaps consider un-deprecating it. This is because some app devs like using it. If you follow the link below, the reason it was deprecated was because there used to be a bug where the spinner's content would not line-up with the other columns correctly. Instead of fixing it, the feature was deprecated and we told devs to use the drop-down picker instead. But we fixed the spinner's bug in 7.3.0. So, I think we should keep it now. :) |
I'm closing this PR in favor of PR #11621 which is focused more on the bug itself. |
JIRA: https://jira.appcelerator.org/browse/TIMOB-27625
Description:
Fix for setting min\max Date for Date type of Ti.UI.Picker. Some code optimization. Adding accessors
for the properties. There was a scenario where the
value
was not matching what the Picker was showing, so in order to avoid that now the getter is returning what the native component is showing.Thus the unit tests that would cover such an attempt.
About DatePickerProxy - would that be a leftover class ? I don't see support for
Ti.UI.createDatePicker
on Android side and I think we can remove the file.Test case:
app.js