Skip to content

Commit

Permalink
add util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
surajmn1 committed Oct 17, 2022
1 parent 87cc9d2 commit 8785c9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions studio/src/utils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ export const getDatefromStringWithoutDay = (dateString) => {
const dateObj = new Date(Date.parse(dateString));
return `${listOfMonths[dateObj.getMonth()]} ${dateObj.getDate()} ${dateObj.getFullYear()}`;
};

export const getDateAndTimeFromString = (dateString) => new Date(dateString).toLocaleString().replaceAll(",","").replaceAll("/","-")
7 changes: 7 additions & 0 deletions studio/src/utils/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const getEventName = (eventLabel) => {
var labelArr = eventLabel.split('.');
for (var i = 0; i < labelArr.length; i++) {
labelArr[i] = labelArr[i][0].toUpperCase() + labelArr[i].slice(1);
}
return labelArr.join(' ');
};

0 comments on commit 8785c9c

Please sign in to comment.