Skip to content

Commit c0ffa96

Browse files
author
Pavel Strunkin
committed
renamed to formatDateTime
1 parent 8279f5d commit c0ffa96

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/_helpers/format.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const formatDate = (date: string) => new Date(date).toLocaleString();
1+
export const formatDateTime = (date: string) => new Date(date).toLocaleString();

src/components/BuildList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from "../contexts";
2323
import { BuildStatusChip } from "./BuildStatusChip";
2424
import { SkeletonList } from "./SkeletonList";
25-
import { formatDate } from "../_helpers/format.helper";
25+
import { formatDateTime } from "../_helpers/format.helper";
2626

2727
const useStyles = makeStyles((theme: Theme) =>
2828
createStyles({
@@ -76,7 +76,7 @@ const BuildList: FunctionComponent = () => {
7676
<Grid container direction="column">
7777
<Grid item>
7878
<Typography variant="caption" color="textPrimary">
79-
{formatDate(build.createdAt)}
79+
{formatDateTime(build.createdAt)}
8080
</Typography>
8181
</Grid>
8282
<Grid item>

src/pages/ProjectListPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
import { Link } from "react-router-dom";
2828
import { Delete, Add } from "@material-ui/icons";
2929
import { routes } from "../constants";
30+
import { formatDateTime } from "../_helpers/format.helper";
3031

3132
const ProjectsListPage = () => {
3233
const theme = useTheme();
@@ -115,7 +116,7 @@ const ProjectsListPage = () => {
115116
<CardContent>
116117
<Typography>Key: {project.id}</Typography>
117118
<Typography>Name: {project.name}</Typography>
118-
<Typography>Updated: {project.updatedAt}</Typography>
119+
<Typography>Created: {formatDateTime(project.createdAt)}</Typography>
119120
</CardContent>
120121
<CardActions>
121122
<Button

src/types/project.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export interface Project {
55
name: string;
66
builds: Build[];
77
updatedAt: string;
8+
createdAt: string;
89
}

0 commit comments

Comments
 (0)