Date format not as expected in TV

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
adz1111
Posts: 12
Joined: 2014-03-31 12:24

Date format not as expected in TV

Post by adz1111 » 2014-04-05 11:43

Hi

Me again - sorry to bombard!

I want the date in TV to be like: 19th March 2014

It currently appears as 19-03-2014 in TV, even though.....

I have set the format as per image below:
Capture1.JPG
Capture1.JPG (68.16 KiB) Viewed 3248 times
I have localization set as per image below:
Capture4.JPG
Capture4.JPG (78.09 KiB) Viewed 3248 times
In MySQL it is set as "Date" type.

Any thoughts please?

Thanks in advance.

Adz1111

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

Re: Date format not as expected in TV

Post by a.gneady » 2014-04-14 05:51

In the generated "tbltimesheets_view.php" file, you'll find a block of code starting with the following comment:

Code: Select all

// Fields that can be displayed in the table view
Could you kindly post this block here to see how the date is getting formatted in the table view?
: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.

adz1111
Posts: 12
Joined: 2014-03-31 12:24

Re: Date format not as expected in TV

Post by adz1111 » 2014-04-14 09:48

Thanks Ahmad - please see block as requested below...

Code: Select all

	// Fields that can be displayed in the table view
	$x->QueryFieldsTV=array(   
		"`tbltimesheets`.`TimesheetID`" => "TimesheetID",
		"IF(    CHAR_LENGTH(`tbltimesheets1`.`TimesheetID`), CONCAT_WS('',   `tbltimesheets1`.`TimesheetID`), '') /* User */" => "User",
		"if(`tbltimesheets`.`WeekCommencing`,date_format(`tbltimesheets`.`WeekCommencing`,'%d-%m-%Y'),'')" => "WeekCommencing",
		"IF(    CHAR_LENGTH(`tblclients1`.`ClientName`), CONCAT_WS('',   `tblclients1`.`ClientName`), '') /* Client */" => "ClientID",
		"IF(    CHAR_LENGTH(`tblclientcontacts1`.`ContactName`), CONCAT_WS('',   `tblclientcontacts1`.`ContactName`), '') /* Client Contact */" => "ClientContactID",
		"IF(    CHAR_LENGTH(`tblagencies1`.`AgencyName`), CONCAT_WS('',   `tblagencies1`.`AgencyName`), '') /* Agency */" => "AgencyID",
		"IF(    CHAR_LENGTH(`tblagencycontacts1`.`ContactName`), CONCAT_WS('',   `tblagencycontacts1`.`ContactName`), '') /* Agency Contact */" => "AgencyContactID",
		"`tbltimesheets`.`MondayHours`" => "MondayHours",
		"`tbltimesheets`.`TuesdayHours`" => "TuesdayHours",
		"`tbltimesheets`.`WednesdayHours`" => "WednesdayHours",
		"`tbltimesheets`.`ThursdayHours`" => "ThursdayHours",
		"`tbltimesheets`.`FridayHours`" => "FridayHours",
		"`tbltimesheets`.`SaturdayHours`" => "SaturdayHours",
		"`tbltimesheets`.`SundayHours`" => "SundayHours",
		"if(`tbltimesheets`.`ClientApprovedDate`,date_format(`tbltimesheets`.`ClientApprovedDate`,'%d-%m-%Y'),'')" => "ClientApprovedDate",
		"`tbltimesheets`.`TotHours`" => "TotHours",
		"`tbltimesheets`.`TotDays`" => "TotDays",
		"`tbltimesheets`.`SignedTimesheet`" => "SignedTimesheet"
	);

Post Reply