Skip to content

Commit

Permalink
Fixed Issue developer-job-simulation#2 - converted ISO 8601 to readable
Browse files Browse the repository at this point in the history
  • Loading branch information
saksben committed Feb 28, 2024
1 parent 52eda51 commit 739d0dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ export const makeTable = async () => {
// Here we simply rearrange company fields in the order in which we want to display them in UI
companies.map(company => {
const row = [];
const readableDate = () => { //creates local readable time
let iso = company[CREATED_AT_FIELD_NAME];
const date = new Date(iso);
return date.getHours() + ":" + date.getMinutes();
}
// let readableDate = company[CREATED_AT_FIELD_NAME].substring(11, 16); //creates universal readable time. May be too simple a solution
row.push(
company[COMPANY_NAME_FIELD_NAME],
company[STATUS_FIELD_NAME],
company[CREATED_AT_FIELD_NAME],
readableDate(), //returns readable time instead of api's company[CREATED_AT_FIELD_NAME]
// readableDate, //returns readable time instead of api's company[CREATED_AT_FIELD_NAME]
company[REVENUE_YTD_FIELD_NAME],
company[ACCOUNT_EXECUTIVE_FIELD_NAME]
);
Expand Down

0 comments on commit 739d0dc

Please sign in to comment.