Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10587] iOS: Picker - The getvalue() method for date picker returns incorrect date

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-11-06T23:51:58.000+0000
Affected Version/sRelease 2.1.2
Fix Version/s2012 Sprint 23 API, 2012 Sprint 23
ComponentsiOS
Labelsapi, qe-ios082012
ReporterNeha Chhabra
AssigneeSabil Rahim
Created2012-08-24T04:37:59.000+0000
Updated2017-03-17T18:49:23.000+0000

Description

The getvalue() method for date picker returns incorrect date. This is not a regression.It occurs as far as 2.0.1. Steps to Reproduce: 1. install and launch the app. 2. set the date in the picker. 3. Click on Get value button. Expected Result: Selected value(date) should be displayed on console. Actual Result: Value (date) that is being returned to the console is one date previous to the selected one. app.js
      var _window = Ti.UI.createWindow({
      	
		backgroundColor : '#000',
	   layout :'vertical',
	   navBarHidden : true
		  
		});
		var datePicker = Ti.UI.createPicker({
		    type: Ti.UI.PICKER_TYPE_DATE,
		    useSpinner: false
		});
		  
		datePicker.addEventListener('change', function(e) {
		  Ti.API.info('change event: value = ' + e.value);
		});
		  
		var button = Ti.UI.createButton({
		    title: 'Get value'
		});
		  
		button.addEventListener('click', function(){
		    Ti.API.info(datePicker.value);
		    Ti.API.info(datePicker.getValue());
		});
		   
		_window.add(datePicker);
		_window.add(button);
	_window.open();

Comments

  1. Sabil Rahim 2012-11-06

    Cannot reproduce on master Tested on TiSDK master (3.1.0 build 4066332) On iPhone 4S running 5.1 on Xcode 4.5.2 in OSX 10.8
  2. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source