on 02-06-2019 11:22 AM
Hello Experts and rohit.chokhani
I am facing the issue with default time for Date column in SmartTable. please find the below screenshot for same.
rohit.chokhani I found similar issue with you too, could you please share the solution/cod snippet so that I can try and check if the formatter works or not.
thank you in advance.
Hi Mahesh,
Thank you for your valuable solution.
After adding the below piece of code still issue was there. When I double check the EDM Core Type in OData I found that column assigned as
Edm.DateTimeOffset. Since it is assigned I was getting default time in SmartTable date column, I changed EDM Core Type as Edm.DateTime.
METHODdefine.
super->define().TRY.DATA(lo_entity_type)= model->get_entity_type( iv_entity_name ='Entity_Name').DATA(lo_property)= lo_entity_type->get_property( iv_property_name ='Date_Property_name').DATA(lo_annotation)= lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation('sap').
lo_annotation->add( iv_key ='display-format'
iv_value ='Date').CATCH/iwbep/cx_mgw_med_exception .ENDTRY.ENDMETHOD.
But the catch is, when download as excel along with date default time 00.00 was coming. after adding above code those default 00.00 time is fixed. Once again Thank you soo much Mahesh for your time.
Regards, Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
You can use a formatter for the field.
Use the below code and you should be able to solve your problem -
<Text text="{path:'viewData>CreatedOn', type:'sap.ui.model.odata.type.DateTime', formatOptions: { pattern: 'MM-dd-yyyy'},constraints: {displayFormat: 'Date'}}"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.