Date format in tablename_view.php

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
wilmira
Veteran Member
Posts: 78
Joined: 2013-07-11 18:00

Date format in tablename_view.php

Post by wilmira » 2015-03-23 20:38

Hello,

I have configured a date field and it should have this format: d/m/Y. I have chosen the UK short Date/Time in the data format tag of the field in appgini. I have also configured this in the database cofiguration option of appgini software (Localization Settings), however my control_view.php files do not change the format m/d/Y to the format I want, so I have to do it manually.

The problem is that, everytime I make a change in my software, it generates the control_view.php, so I have to change those values every time.

Does anybody knows if this is a bug, or it is something I am not doing right?

Thanks in advance,

Wilfredo Mira

Satya Kavala
Veteran Member
Posts: 45
Joined: 2015-04-15 06:33
Location: Hyderabad
Contact:

Re: Date format in tablename_view.php

Post by Satya Kavala » 2015-04-20 07:54

hi wilmira,
I think you have control.php file in hooks folders of your application so there you can change the format of the day as like you want.

function control_before_insert(&$data, $memberInfo, &$args)
{
$data['date']=date_format($data['date'],"Y-m-d h:i:s");//change the date format as you want

}
you can place the date change code in either before insert or after insert functions.

from the above changes you need not to change the format again again in any where it will change its format automatically depending upon your code.

thanks&Regards
Satya kavala
[email protected].
Thanks&Regards
Satya Kavala
[email protected]

Post Reply