Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

sap.m.DateTimeInput - Date Format issue

$
0
0

Hello,

 

I have a sap.m.DateTimeInput control on a page, and I have set the displayFormat to what my users would like.

The input is bound to a JSON model and the binding value works fine. When the user changes the value, the year portion of the date format turns back to "YYYY"

 

JSView

  var osdInput = new sap.m.DateTimeInput("dposd", {      dateValue: "{/thing/OutOfServiceDate}",      type: "DateTime",      enabled: "{/thing/OutOfServiceDate}" === null ? false : true,      displayFormat: "dd-MMM-YYYY HH:mm",          });

On initial binding, I get this:

bound.PNG

But than after changing the value in the UI, I get this:

after.PNG

How can I set up the various format strings so that I can display the date in my desired format?

 

Thanks,

 

Al Irvine

 

PS: Is there a property that I can set to restrict future dates, or do I have to handle that in the change event?


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>