noticed date raised incorrect after change in file naming convention.. didnt sort correctly
This commit is contained in:
@@ -56,9 +56,13 @@ const TopThree = (props) => {
|
||||
let showTopThreeArr = showTopThree.value;
|
||||
|
||||
Object.keys(showTopThreeArr).map((key, index) => {
|
||||
let createdDate = parseInt(
|
||||
showTopThreeArr[key].repfile_name.split("-")[3]
|
||||
);
|
||||
let createdDate = showTopThreeArr[key].repfile_name.split("_-_");
|
||||
createdDate =
|
||||
createdDate[0].replace(
|
||||
/(?<=\d{4}-\d{2}-\d{2})-(?=\d{2}:\d{2}:\d{2})/,
|
||||
"T"
|
||||
) + "Z";
|
||||
|
||||
showTopThreeArr[key].createdDate = createdDate;
|
||||
});
|
||||
|
||||
@@ -163,18 +167,17 @@ const TopThree = (props) => {
|
||||
};
|
||||
|
||||
const repRaisedDate = (datePart) => {
|
||||
var dateStr = datePart.split("_-_")[0];
|
||||
var timeStr = dateStr.split("-")[3];
|
||||
|
||||
var dateObj = new Date(
|
||||
datePart.split("-")[0] +
|
||||
dateStr.split("-")[0] +
|
||||
"-" +
|
||||
datePart.split("-")[1] +
|
||||
dateStr.split("-")[1] +
|
||||
"-" +
|
||||
datePart.split("-")[2] +
|
||||
dateStr.split("-")[2] +
|
||||
" " +
|
||||
datePart.split("-")[3].split("_")[0].slice(0, 2) +
|
||||
":" +
|
||||
datePart.split("-")[3].split("_")[0].slice(2, 4) +
|
||||
":" +
|
||||
datePart.split("-")[3].split("_")[0].slice(4, 6)
|
||||
timeStr
|
||||
);
|
||||
|
||||
return dateObj.toLocaleString();
|
||||
|
||||
Reference in New Issue
Block a user