Page 1 of 1

Date issue

Posted: 2013-11-07 20:06
by HBmike
Simple issue I am sure, but I cannot seem to figure it out. I have the date picker in use to choose a date. Works fine. Problem is that it stores the date day/month/year. I need it to show month/day/year when it hits the TV. Any ideas how to change it?

Thanks,
Mike

PS> How are you supposed to search the forum when everything is too common and therefore ignored? I put in "format date" and it said nothing found because it ignored format and date as they were to common. I even tried forcing it to fond it by saying it had to be found "+Format" and it ignored it anyways. Sorry, just frustrated that I have to ask a question when It probably was answered somewhere but I cannot search it.

Re: Date issue

Posted: 2013-11-07 21:55
by peebee
Try the "Data Format" tab for the desired field(s) in AppGini

Re: Date issue

Posted: 2013-11-07 23:15
by HBmike
Thanks! I remember that part. However I have done so many changes to the script I hate having to regenerate the code just for a date format. Any ideas where the format would be in the generated code?

Thanks again!

Re: Date issue

Posted: 2013-12-02 23:50
by a.gneady
Sorry for answering this after such long time @HBMike, if you haven't figured it already, the data format affects "tablename_view.php" and "tablename_dml.php" files ... so you need only to generate those 2 ones (where tablename is the name of the concerned table)

Re: Date issue

Posted: 2013-12-04 17:39
by HBmike
No, I still had not found it. But I have now. Thank you. Now to figure out how to write an if statement to check it the date and use a different css if past due. Fun fun fun :)

Thanks again!

Re: Date issue

Posted: 2013-12-04 21:13
by HBmike
Ok so the code I am playing with is from the "tablename_dml.php" and reads:

Code: Select all

		$templateCode=str_replace('<%%VALUE(order_end_date)%%>', @date('d/m/Y', @strtotime(htmlspecialchars($row['order_end_date'], ENT_QUOTES))), $templateCode);
		$templateCode=str_replace('<%%URLVALUE(order_end_date)%%>', urlencode(@date('d/m/Y', @strtotime(htmlspecialchars($urow['order_end_date'], ENT_QUOTES)))), $templateCode);
	
This code, if I am correct, actually replaces the code in the template with the date from the database. What I am trying to do is have the result show as red or bold if it is older than the current date. Basically so it can be seen in a glance that it is overdue. Any ideas? I will play with it and see what I can come up with.

Happy Holidays everyone!

Mike