on 09-07-2018 10:18 AM
HI All,
I am Getting the Date field as a string(20171004) format, i need show as a Date Format
( 2017 October 04 ) pls help dateissue.jpg
Well, what you can do is to
var match = /([0-9]{4})([0-9]{2})([0-9]{2})/gi.exec("20171004");
var matchedDate = new Date(match[1], match[2]-1, match[3]);
var dateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern : "YYYY/MM/dd" });
var dateFormatted = dateFormat.format(matchedDate);
Now what you need to do is just to edit the pattern value in which format you want to print it to the user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're welcome! Don't forget to also up vote the answer 😉
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.