Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16243] iOS: Date objects are messed up when sent through a global event

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsdate, fireevent, ios
ReporterKarl Nilsson
AssigneeUnknown
Created2014-01-15T13:58:35.000+0000
Updated2018-02-28T20:03:22.000+0000

Description

Problem

When date objects are sent as part of the object that is the argument of a global event (Ti.App.fireEvent()) they are modified so that the received date is not the same as the one that was sent.

Test case

Ti.UI.createWindow().open();

var a = new Date(2014,1,15,1,2,3);

Ti.App.addEventListener("test", fn);

Ti.App.fireEvent("test", {
	Data: a
});

function fn(e) {
	alert("Expected: " + a.toString() + " What was received: " + e.Data.toString());
}


Discussions

Run the test case above and you will see that obviously the date is changed during "transfer". (It does not seem to happen on Android). I guess there is something that differs between how objective-c and the javascript engine handles Date objects.

Comments

  1. Unknown 2014-04-21

    This issue was previously scheduled to be worked on in more than one sprint: * 'Release 3.1.2' (on board '3.1.X Triage') * 'Release 3.0.1/TS 3.0.2' (on board '3.1.0 Triage') * 'Triage' (on board '3.2.X Triage') Starting from JIRA Agile 6.3, an issue can only belong to a single future sprint. Read more about this change: http://docs.atlassian.com/agile/docs-0630/Sprint+Marker+Migration This issue is now scheduled for future sprint 'Release 3.1.2' (on board '3.1.X Triage'). If this is incorrect, please update the issue accordingly. This comment was automatically generated by JIRA. If it is no longer relevant, please feel free to delete it.

JSON Source