<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SAPUI5 DatePicker - short format issue in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234053#M4580052</link>
    <description>&lt;P&gt;Hi Boghyon&lt;/P&gt;&lt;P&gt;- Edm.DateTime&lt;/P&gt;&lt;P&gt;- Odata V2&lt;/P&gt;&lt;P&gt;- format is like this: "InputAfregnDato":"\/Date(1606694400000)\/",&lt;/P&gt;</description>
    <pubDate>Sun, 15 Nov 2020 15:24:29 GMT</pubDate>
    <dc:creator>jakob_steen-petersen</dc:creator>
    <dc:date>2020-11-15T15:24:29Z</dc:date>
    <item>
      <title>SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaq-p/12234049</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I have a DatePicker like this&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;DatePicker id="inputAfregnDato" displayFormat="short" value="{ path: 'InputAfregnDato', type: 'sap.ui.model.odata.type.DateTime', formatOptions: { displayFormat: 'Date',                		                                                        UTC: true             } }"/&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But when i pick a date it display like this:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1860797-sap.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;How can i display just a simple date like 20.11.2020 ?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 14:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaq-p/12234049</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2020-11-14T14:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234050#M4580049</link>
      <description>&lt;P&gt;As explained in this &lt;A href="https://stackoverflow.com/a/47603778/5846045"&gt;answer&lt;/A&gt; as well as in this &lt;A href="https://openui5.hana.ondemand.com/topic/e1ddc69c01474faf830a522db8c9238a"&gt;topic &lt;EM&gt;Date and Time Related Controls: Data Binding&lt;/EM&gt;&lt;/A&gt;, the attribute &lt;STRONG&gt;'displayFormat' should be added to 'constraints'&lt;/STRONG&gt; instead of 'formatOptions'.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;DatePicker id="inputAfregnDato"&lt;BR /&gt;  value="{&lt;BR /&gt;    path: 'InputAfregnDato',&lt;BR /&gt;    type: 'sap.ui.model.odata.type.DateTime',&lt;BR /&gt;    constraints: {&lt;BR /&gt;      displayFormat: 'Date'&lt;BR /&gt;    }&lt;BR /&gt;  }"&lt;BR /&gt;/&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Nov 2020 15:25:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234050#M4580049</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2020-11-14T15:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234051#M4580050</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;Tried that - it gives the exact same result.....&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 15:34:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234051#M4580050</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2020-11-14T15:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234052#M4580051</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;jakob.steen-petersen&lt;/SPAN&gt; Ok, then let's debug together.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is the Type of the "InputAfregnDato" property in $metadata "Edm.DateTime" in the first place?&lt;/LI&gt;&lt;LI&gt;Are you working with OData V2? Or V4?&lt;/LI&gt;&lt;LI&gt;What is the format of the date value in JSON output? (should look &lt;A href="https://services.odata.org/V2/Northwind/Northwind.svc/Orders%2810643%29/OrderDate?$format=json"&gt;like this&lt;/A&gt;) &lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 14 Nov 2020 15:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234052#M4580051</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2020-11-14T15:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234053#M4580052</link>
      <description>&lt;P&gt;Hi Boghyon&lt;/P&gt;&lt;P&gt;- Edm.DateTime&lt;/P&gt;&lt;P&gt;- Odata V2&lt;/P&gt;&lt;P&gt;- format is like this: "InputAfregnDato":"\/Date(1606694400000)\/",&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 15:24:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234053#M4580052</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2020-11-15T15:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234054#M4580053</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;jakob.steen-petersen&lt;/SPAN&gt; Is the default model on the DatePicker a "sap.ui.model.odata.&lt;STRONG&gt;v2.&lt;/STRONG&gt;ODataModel"? Or are you using an intermediate JSONModel to manipulate the response from the OData service? It just seems very odd that the value is "30. nov. 2020 00.00.00". I can't reproduce that format with ODataModel only.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 12:02:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234054#M4580053</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2020-11-19T12:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234055#M4580054</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Yes - model is sap.ui.model.odata.&lt;STRONG&gt;v2.&lt;/STRONG&gt;ODataModel&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1864491-u58jh.png" /&gt;&lt;/P&gt;&lt;P&gt;No intermediate JSONModel is used....&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 13:34:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234055#M4580054</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2020-11-19T13:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234056#M4580055</link>
      <description>&lt;P&gt;Hi Boghyon&lt;/P&gt;&lt;P&gt;I have no idea why - but problem is solved. What i did was to completely delete the field definition in the view and started all over with new field. &lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;DatePicker id="inputAfregnDato" value="{ path: 'InputAfregnDato', UTC: true }" &amp;gt;
&amp;lt;/DatePicker&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So now it is fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks for you help anyway!!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 19:31:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234056#M4580055</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2020-11-19T19:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234057#M4580056</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;jakob.steen-petersen&lt;/SPAN&gt; Good to hear that it worked. But what do you mean by "delete the field definition / start over with new field"? What is a field exactly? Anyhow, the `UTC` property won't do anything if it's added there. PropertyBinding has no UTC (See &lt;A href="https://openui5.hana.ondemand.com/api/sap.ui.base.ManagedObject#methods/bindProperty"&gt;API reference "bindProperty"&lt;/A&gt;). It does, however, support the "type". Please try again with the &lt;A href="https://answers.sap.com/answers/13187902/view.html"&gt;snippet from the answer&lt;/A&gt;. If the default model on the DatePicker is v2.ODataModel with the response fully conforming to the OData spec, the snippet will work as demonstrated and explained in other resources.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 20:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234057#M4580056</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2020-11-19T20:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 DatePicker - short format issue</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234058#M4580057</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;jakob.steen-petersen&lt;/SPAN&gt; I'd suggest to remove `UTC: true` altogether unless it's absolutely required by the business. Otherwise, you might get 1 day plus/minus off depending on the user's locale setting. Display date / date-time / time always in user's local time (no UTC). When used together with "&lt;STRONG&gt;type: 'sap.ui.model.odata.type.DateTime'&lt;/STRONG&gt;" and "&lt;STRONG&gt;constraints: {
      displayFormat: 'Date'
    }&lt;/STRONG&gt;", the date will be sent to backend in UTC anyway (due to use of Date#getTime internally. See the &lt;A href="https://github.com/SAP/openui5/issues/2543"&gt;discussion here&lt;/A&gt;) but the value is &lt;STRONG&gt;displayed&lt;/STRONG&gt; in the user's local time (without the potential 1 day offset) as it typically should be.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 20:23:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-datepicker-short-format-issue/qaa-p/12234058#M4580057</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2020-11-19T20:23:35Z</dc:date>
    </item>
  </channel>
</rss>

