Date issue

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
HBmike
Posts: 18
Joined: 2013-08-30 18:02

Date issue

Post by HBmike » 2013-11-07 20:06

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.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Date issue

Post by peebee » 2013-11-07 21:55

Try the "Data Format" tab for the desired field(s) in AppGini
Attachments
date_format.jpg
date_format.jpg (163.08 KiB) Viewed 5446 times

HBmike
Posts: 18
Joined: 2013-08-30 18:02

Re: Date issue

Post by HBmike » 2013-11-07 23:15

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!

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Date issue

Post by a.gneady » 2013-12-02 23:50

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)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

HBmike
Posts: 18
Joined: 2013-08-30 18:02

Re: Date issue

Post by HBmike » 2013-12-04 17:39

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!

HBmike
Posts: 18
Joined: 2013-08-30 18:02

Re: Date issue

Post by HBmike » 2013-12-04 21:13

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

Post Reply