Skip to content

Commit 39e557c

Browse files
committed
created robust implementation of date method using fixed locale and options
1 parent 3c3ed70 commit 39e557c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const makeTable = async () => {
2222
// Here we simply rearrange company fields in the order in which we want to display them in UI
2323
companies.map(company => {
2424
const row = [];
25-
company[CREATED_AT_FIELD_NAME] = new Date(company[CREATED_AT_FIELD_NAME]).toString().substring(4, 21)
25+
company[CREATED_AT_FIELD_NAME] = new Date(company[CREATED_AT_FIELD_NAME]).toLocaleString('en-US', { hour12: false, year: 'numeric', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' })
2626
row.push(
2727
company[COMPANY_NAME_FIELD_NAME],
2828
company[STATUS_FIELD_NAME],

0 commit comments

Comments
 (0)