Skip to content

Commit

Permalink
feat: foramt commit author date
Browse files Browse the repository at this point in the history
  • Loading branch information
damingerdai committed Feb 12, 2024
1 parent adb9c36 commit d73a824
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@mui/material": "^5.0.4",
"@reduxjs/toolkit": "^1.6.2",
"core-js": "^3.18.3",
"dayjs": "^1.11.10",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^7.2.6",
Expand Down
3 changes: 2 additions & 1 deletion src/main/react/src/pages/repos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TableCell from '@mui/material/TableCell';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import Paper from '@mui/material/Paper';
import dayjs from 'dayjs';

import { fetchCommits } from '../slices/repos';
import { useAppDispatch, useAppSelector } from '../slices/hook';
Expand Down Expand Up @@ -46,7 +47,7 @@ const Repos = () => {
<TableCell align="left">{commit.author.name}</TableCell>
<TableCell align="left">{commit.committer.name}</TableCell>
<TableCell align="left">{commit.sha}</TableCell>
<TableCell align="left">{commit.author.date}</TableCell>
<TableCell align="left">{dayjs(commit.author.date).format('MM/DD/YYYY HH:mm:ss')}</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
5 changes: 5 additions & 0 deletions src/main/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2045,6 +2045,11 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"

dayjs@^1.11.10:
version "1.11.10"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0"
integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==

debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
Expand Down

0 comments on commit d73a824

Please sign in to comment.