cancel
Showing results for 
Search instead for 
Did you mean: 

How to change date format in UploadCollection

Former Member
0 Kudos

Hi,

I want to change the date format in an UploadCollectionItem. I use Smart Templates and the field comes from the backend as DATS.

Currently, the Date shows:

Thu Mar 03 2016 01:00:00 GMT+0100 (W. Europe Standard Time)

But I want it like this: 2016-03-03

How can i change the format?

View:

<UploadCollection fileType="undefined" id="__collection0" items="{to_Documents}" maximumFileSize="0" maximumFilenameLength="0"

  mimeType="undefined">

  <items>

  <UploadCollectionItem

     contributor="{created_by}"

     enableDelete="false"

     enableEdit="false"

     fileName="{file_name}"

       mimeType="{mime_type}"

     uploadedDate="{created_on_dats}"

       url="/sap/opu/odata/sap/ZMM_TEST5_SRV/Document(guid=guid'{guid}',entity_guid=guid'{entity_guid}',edms_guid=guid'{edms_guid}')/$value"

       visibleDelete="false"

     visibleEdit="false">

  <attributes></attributes>

  <statuses></statuses>

  </UploadCollectionItem>

  </items>

  </UploadCollection>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marcel,

Have you taken a look at the dateformatter?   Example in the demo kit.

OpenUI5 SDK - Demo Kit

OpenUI5 SDK - Demo Kit

Former Member
0 Kudos

Thanks for the reply, I got it now:

uploadedDate="{ path: 'created_on_dats',

  type: 'sap.ui.model.type.Date',

  formatOptions: {

  style: 'short'

  }}"

See SAPUI5 explored:

https://sapui5.netweaver.ondemand.com/explored.html#/entity/sap.ui.model.type.Date/samples

Answers (0)