You need to sign in to do that
Don't have an account?
TheLearner
Hi Experts,
I need to change the format of Installation_Date__c into YYYY-MM-DD,here is the code where Installation_Date__c field is used , could anyone help me please
for(TWM_Meter__c meter : [select id, Meter_Location__c, Meter_Box_Type__c, Exact_location_of_Meter__c, Meter_Grid_Ref_No__c,
Serial_No__r.Name, In_Line_or_Concentric__c, Meter_Make__c, Meter_Type__c, Meter_Size__c, Flow_Rate__c, No_of_Dials__c,
Manufactured_year__c, Last_Reading__c, Installation_Date__c, LCE_Fitted__c, LCE_Reader_Serial_No__c,
LCE_Location__c, LCE_Grid_Ref__c, New_Radio_ID__c, Pulse__c, Property_Outer_Postcode__c,Property_Inner_Postcode__c,
Northings__c, Eastings__c, Exchange_Radio_ID__c, Task__r.Job__c,
Meter_Location_Description__c, Task__r.name, // CH04
Tech_Type__c,DMA__c,MIU_fitted__c,New_MIU_Reader_Serial_Number__c,MIU_location__c,MIU_Grid_ref__c from TWM_Meter__c where Task__r.Job__c in : mapJobTasks.keySet()
AND ((Installation_Date__c >=:twmJobInst.Required_Start_Date__c //CH09
AND Installation_Date__c <=:twmJobInst.Required_Completion_Date__c)//CH09
OR (Installation_Date__c = null))//CH09
order by Task__r.name]){ //CH04 Added order by // CH06.New
strItemRow += formatDate(meter.Installation_Date__c) + '|';
changing the date format in the apex class
Hi Experts,
I need to change the format of Installation_Date__c into YYYY-MM-DD,here is the code where Installation_Date__c field is used , could anyone help me please
for(TWM_Meter__c meter : [select id, Meter_Location__c, Meter_Box_Type__c, Exact_location_of_Meter__c, Meter_Grid_Ref_No__c,
Serial_No__r.Name, In_Line_or_Concentric__c, Meter_Make__c, Meter_Type__c, Meter_Size__c, Flow_Rate__c, No_of_Dials__c,
Manufactured_year__c, Last_Reading__c, Installation_Date__c, LCE_Fitted__c, LCE_Reader_Serial_No__c,
LCE_Location__c, LCE_Grid_Ref__c, New_Radio_ID__c, Pulse__c, Property_Outer_Postcode__c,Property_Inner_Postcode__c,
Northings__c, Eastings__c, Exchange_Radio_ID__c, Task__r.Job__c,
Meter_Location_Description__c, Task__r.name, // CH04
Tech_Type__c,DMA__c,MIU_fitted__c,New_MIU_Reader_Serial_Number__c,MIU_location__c,MIU_Grid_ref__c from TWM_Meter__c where Task__r.Job__c in : mapJobTasks.keySet()
AND ((Installation_Date__c >=:twmJobInst.Required_Start_Date__c //CH09
AND Installation_Date__c <=:twmJobInst.Required_Completion_Date__c)//CH09
OR (Installation_Date__c = null))//CH09
order by Task__r.name]){ //CH04 Added order by // CH06.New
strItemRow += formatDate(meter.Installation_Date__c) + '|';
Otherwise you'll have to do generate the formatted date yourself
Additionally you could convert it to a Datetime and use it's formatting method
In your controller build up a list of wrapped objects
and then in your page, repeat over those
NOTE: This code has not been tested and my contain typographical or logical errors. Use at your own risk.