Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4011] fireEvent with datetime object modify the datetime content

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2016-07-20T19:44:17.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsDateTime, SDK3.5.0, Ti.App.fireEvent
Reporterjmarty
AssigneeShak Hossain
Created2016-07-07T10:06:14.000+0000
Updated2016-07-21T07:20:29.000+0000

Description

SDK used : 3.5.2.v20160311103211 I create a datetime in object and I fired this object with Ti.App.fireEvent() and in the result, my datetime value was modified. Exemple : //index.xml //index.js function doClick(e) { var result = new Date("2016-07-07T00:00:00+02:00"); var evtData = {result: result}; Ti.App.fireEvent('test',evtData); } Ti.App.addEventListener('test', function(e){ Ti.API.error("Original date = 2016-07-07T00:00:00+02:00" + " - date received = " + JSON.stringify(e)); }); $.index.open(); CURRENT RESULT = 2016-07-06T22:00:28.928Z WAITING RESULT = 2016-07-06T22:00:00.000Z

Comments

  1. Sharif AbuDarda 2016-07-16

    I see you are using an old SDK. Can you try with the latest SDK 5.3.1.GA. For me the above code shows with SDK 5.3.0.GA
       [ERROR] :  Original date = 2016-07-07T00:00:00+02:00 - date received = {"type":"test","source":{"deployType":"development","id":"com.gsl.shajib","name":"sha140","version":"1.0","__propertiesDefined__":true,"Properties":{"apiName":"Ti.App.Properties","bubbleParent":true},"description":"undefined","Android":{"bubbleParent":true,"launchIntent":{"action":null,"bubbleParent":true,"data":null,"type":null,"apiName":"Ti.Android.Intent","flags":268435456},"appVersionCode":1,"appVersionName":"1.0","apiName":"Ti.App.Android","R":{"bubbleParent":true,"apiName":"Ti.Android.R"}},"_events":{"test":{}},"bubbleParent":true,"guid":"0cd6ed1f-8aef-4d5b-9222-c0f3b17db37a","copyright":"2016 by gsl001","url":"undefined","proximityState":false,"proximityDetection":false,"publisher":"gsl001","accessibilityEnabled":false,"apiName":"Ti.App","sessionId":"2cb3ace1-f143-4641-a52c-46cfc998a490","analytics":true},"result":"2016-07-06T22:00:00.000Z","bubbles":false,"cancelBubble":false}
       
    Thanks.
  2. jmarty 2016-07-21

    If I use another SDK, all my project changes. To test with the latest SDK, I must update my sdk, my XCode ...etc I broke my project... I can't test with the latest SDK. But the SDK 3.5 is not updated ?

JSON Source