Skip to content

Commit

Permalink
Bug: Fix to show date
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiop committed Jan 12, 2022
1 parent 09d7c34 commit 0a360d3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
5 changes: 4 additions & 1 deletion client-next/src/components/UI/ContentsList/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { IContent } from 'types/content.interface';
import { useNavigate } from 'react-router-dom';
import { DateUtil } from '@utils/index';
import * as S from './style';
import TagList from './TagList';

Expand All @@ -21,7 +22,9 @@ const Content = ({ className, content }: IContentsComponent) => {
<div className="category">
{content.mainCategory.title}/{content.subCategory.title}
</div>
<div className="date">{content.date}</div>
<div className="date">
{DateUtil.getYMD(new Date(content.updateAt))}
</div>
</div>
<TagList tagList={content.tags} />
</S.SubInfo>
Expand Down
2 changes: 1 addition & 1 deletion client-next/src/components/UI/Post/Titlebox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getYMD } from '@lib/date';
import { getYMD } from '@utils/date';
import * as S from './style';

interface TitleBox {
Expand Down
12 changes: 6 additions & 6 deletions client-next/src/fixture/ContentsList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@ const testObj = {
export const testContentList: IContent[] = [
{
title: 'κΈ€ 1',
date: '첫번째 κΈ€μ—λŒ€ν•œ λ‚΄μš©μž…λ‹ˆλ‹€.',
updateAt: new Date('2020-10-20'),
slug: '/1',
...testObj,
},
{
title: 'κΈ€ 2',
date: 'λ‘λ²ˆμ§Έ κΈ€μ—λŒ€ν•œ λ‚΄μš©μž…λ‹ˆλ‹€.',
updateAt: new Date('2020-10-20'),
slug: '/1',
...testObj,
},
{
title: 'κΈ€ 3',
date: 'μ„Έλ²ˆμ§Έ κΈ€μ—λŒ€ν•œ λ‚΄μš©μž…λ‹ˆλ‹€.',
updateAt: new Date('2020-10-20'),
slug: '/1',
...testObj,
},
{
title: 'κΈ€ 4',
date: 'λ„€λ²ˆμ§Έ κΈ€μ—λŒ€ν•œ λ‚΄μš©μž…λ‹ˆλ‹€.',
updateAt: new Date('2020-10-20'),
slug: '/1',
...testObj,
},
{
title: 'κΈ€ 5',
date: 'λ‹€μ„―λ²ˆμ§Έ κΈ€μ—λŒ€ν•œ λ‚΄μš©μž…λ‹ˆλ‹€.',
updateAt: new Date('2020-10-20'),
slug: '/1',
...testObj,
},
];

export const testContent: any = {
title: '제λͺ©μž…λ‹ˆλ‹€.',
date: '2020-20-20',
date: '2020-10-20',
};
2 changes: 1 addition & 1 deletion client-next/src/types/content.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ITag } from './tag.interface';

export interface IContent {
title: string;
date: string;
updateAt: Date;
slug: string;
mainCategory: IMainCategory;
subCategory: ISubCategory;
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions client-next/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as DU from './date';

export const DateUtil = DU;
export default {};

0 comments on commit 0a360d3

Please sign in to comment.