[ALOY-263] Implement Ti.UI.Picker parser (DATE & DATE_TIME)
|Fix Version/s||Alloy 1.4.0, 2014 Sprint 08|
- Tim Poulsen 2013-03-26
Tried this today, of course it failed, then I found this ticket.
Seems like the obvious way to implement support would be to simply pass the values of the minDate, maxDate, and value attributes to the
<Picker id="picker" top="50" type="Ti.UI.PICKER_TYPE_DATE" minDate="2013,0,1" maxDate="2014,11,31" value="2014,3,12"> </Picker>
new Date()constructor. Thus, values could be any string that the Date() constructor accepts. Alternatively, since moment.js is built in, you could pass the values to moment() and accept whatever strings it supports.
- Tim Poulsen 2014-03-18 PR: https://github.com/appcelerator/alloy/pull/349 Functional test 1. Run the associated ALOY-263 test app. You should get a date-style picker. 2. Edit the views/index.xml or styles/index.tss and change any of the value, minDate, or maxDate values to an invalid date string (e.g. 2013,0,0). Then build. The build will fail with an error message noting which field contained the invalid date. 3. Note that the value of the text field, while a parseable date string, is not converted to a date object (or its toString() representation).
- Tim Poulsen 2014-04-15 PR merged
- Tim Poulsen 2014-04-21 Reimplemented using moment.js to support a broader variety of string formats for the date/time values. In this new implementation, you cannot use milliseconds as a value for any of the date attributes. But anything else parseable by moment should work. New PR merged, https://github.com/appcelerator/alloy/pull/367
- Federico Casali 2014-05-09 Verified working as expected on iOS 7, Android 4.3 and MobileWeb. TiSDK 3.3.0.v20140507163312 Alloy 1.4.0-dev Appcelerator Studio 188.8.131.52405011408 CLI 3.3.0-dev Closing.