Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20360] ArrowDB Event changing date of event

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterOlabosipo Shoroye
AssigneeUnknown
Created2016-02-06T21:35:04.000+0000
Updated2018-02-28T19:55:28.000+0000

Description

My code looks like in the attachment below and the console.log is printing out the correct date also in the 2nd attachment however when displaying the date on the backend it changes the 2016 to 2006. Please fix quickly as App is soon going live!

Attachments

FileDateSize
Screen Shot 2016-02-06 at 09.31.56.png2016-02-06T21:34:19.000+000019402
Screen Shot 2016-02-06 at 09.32.29.png2016-02-06T21:34:19.000+000024378

Comments

  1. Jebun Naher 2016-02-07

    Hello, We tested this issue and event date is showing as expected. Can you add more information on how you are displaying the date on the backend? *Test Code:*
       ACS.Events.query({
       	        where : {
       	            "name" : {
       	               // "$in" :['movie','netflix']
       		         "$in" :['movie','netflix','']
       	            }
       	        }				
       		//tags : {'$in': ['movie','netflix']}
       	    }, function(e) {
       	        if (e.success) {
       	        	 Ti.API.info("Total event is "+e.events.length);
       	            Ti.API.info( "Total event is"+JSON.stringify(e.events) );	           
       	        } else {
       	            alert('Some error occurred');
       	        }
       	    });
       	}
       
    *Output:*
       [INFO] :   Total event is 2
       [INFO] :   Total event is[{"id":"56b704e73477c0090b57a620","name":"netflix","start_time":"2016-02-07T08:47:00+0000","duration":7200,"created_at":"2016-02-07T08:48:39+0000","updated_at":"2016-02-07T08:48:39+0000","ical":"DTSTART:20160207T084700Z\nDURATION:PT2H","recurring_until":"2016-02-07T08:47:00+0000","num_occurrences":1,"details":"fun","user_id":"5669545c4a522f0907d824c2"},{"id":"56b704b2bb2d99bd563456d9","name":"movie","start_time":"2016-02-07T08:46:00+0000","duration":3600,"created_at":"2016-02-07T08:47:46+0000","updated_at":"2016-02-07T08:47:46+0000","ical":"DTSTART:20160207T084600Z\nDURATION:PT1H","recurring_until":"2016-02-07T08:46:00+0000","num_occurrences":1,"details":"enjoyment","user_id":"5669545c4a522f0907d824c2"}]
       
    Thanks.
  2. Olabosipo Shoroye 2016-02-11

    Your test code is for a different issue I created, please double check
  3. Olabosipo Shoroye 2016-02-11

    For the date problem all I did was get values from a textfield(dayinput.getValue()) and timepicker as shown in the attached image. The console.log gives me the value shown in the other image attached and I just realised the two values given in the console.log are different, one is 2016-2-9 and the other is Feb 06 2016 (different dates) so somewhere on the backend things are getting messed up. I am using your pre-defined events backend with no modification.
  4. Olabosipo Shoroye 2016-02-11

    My system is a mac, using your studio.
  5. Olabosipo Shoroye 2016-02-11

    I will test the events query for $in tomorrow and report back
  6. Srikanth Sombhatla 2016-02-17

    [~Mr Shakes] I tried to reproduce this issue by selecting a date from picker and creating an event from the selected date as start_time. It works as expected.
       {"id":"56c3fbdf995248ea6af4f1f4","name":"Celebration","start_time":"2016-02-14T04:49:18+0000","duration":3600,"created_at":"2016-02-17T04:49:35+0000","updated_at":"2016-02-17T04:49:35+0000","ical":"DTSTART:20160214T044918Z\nDURATION:PT1H\nRRULE:FREQ=MONTHLY;COUNT=5","recurring":"monthly","recurring_count":5,"num_occurrences":5,"user_id":"56c3f11751f034ed6cebfb97"}
       
    I see that you are providing a formatted string as an input to start_time. Before that can you create Date with the formatted string and print it to see if the formatted string is correct. Your date string should confirm to RFC 2822. See [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse] Try providing your code.
  7. Olabosipo Shoroye 2016-02-17

    I tried using Date picker initially and it worked for Android but it kept setting the date to 1970 for IOS and thats why I switched to the input style method above. I will try the other suggestion and report back soon.
  8. Olabosipo Shoroye 2016-02-17

    The $in is working for 'name' of event but not for tags, please test for tags.
  9. Olabosipo Shoroye 2016-02-17

    I used the new Date for the date and it worked thanks, still having problems with the tags for $in

JSON Source