Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- formatDateStr: function(data){
- if(data === null || data === undefined){
- return data;
- }else{
- var oDate = new Date(data);
- var iLocalTime = oDate.getTime();
- // Berlin timezone = UTC+1 = 1hr = 60min ahead
- // 60min * 60000 for time in milliseconds
- var iBerlinOffset = 60 * 60000;
- var iLocalOffset = oDate.getTimezoneOffset() * 60000;
- var iBerlinTime = iLocalTime + iLocalOffset + iBerlinOffset;
- oDate.setTime(iBerlinTime);
- var dateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern : "MMM, dd YYYY" });
- var dateFormatted = dateFormat.format(oDate);
- return dateFormatted;
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement