Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to push a stored date to an array?

$
0
0

I´m using ios simulator and I insert the date and time to local databse like this:

('INSERT INTO tablevisit(name,lastname,company,visitto,timein)VALUES(?,?,?,?,datetime("now","localtime")); ----> etc

That works fine, the date and time is inserted into the table. How do I know this: because i used an alert to show the last record of the column timein in my db. The format that the alert show the stored dateandtime in the alert = 2014-10-08 17:24:57

But i have another window that shows all records in arrays, i´m able to show arrays for name, lastname, but when i try to show timein column the app does not show anything and fails.

I do show the arrays like this:

var arraycompany = []; var arraytimein = []; while (rows.isValidRow()) { arrayname.push({title:rows.fieldByName("name"), hasChild:false, functionid:rows.fieldByName("id")}); arraylastname.push({title:rows.fieldByName("lastname"), hasChild:false, functionid:rows.fieldByName("id")}); arraycompany.push({title:rows.fieldByName("company"), hasChild:false, functionid:rows.fieldByName("id")});

Here is where I have the array for column timein from my database:

arraytimein.push({title:rows.fieldByName("timein"), hasChild:true, functionid:rows.fieldByName("id")}); rows.next(); } rows.close(); db.close();

My column that contains the date and time = timein

Thanks for the help! :)


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>