Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8695

Re: oData time formatting in sapui5

$
0
0

HI Ashitha

 

the formatter can be

Time: function(val) {  if (val) {    val = val.replace(/^PT/, '').replace(/S$/, '');    val = val.replace('H', ':').replace('M', ':');    var multipler = 60 * 60;    var result = 0;    val.split(':').forEach(function(token) {      result += token * multipler;      multipler = multipler/ 60;    });    var timeinmiliseconds = result * 1000;    var timeFormat = sap.ui.core.format.DateFormat.getTimeInstance({      pattern: "KK:mm:ss a"    });    var TZOffsetMs = new Date(0).getTimezoneOffset() * 60 * 1000;    return timeFormat.format(new Date(timeinmiliseconds + TZOffsetMs));  }  return null;  
}

Viewing all articles
Browse latest Browse all 8695

Trending Articles



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