File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <p class =" area-date" >{{ formettedPublishedAt }}</p >
2
+ <p class =" area-date" >{{ formattedPublishedAt }}</p >
3
3
</template >
4
4
5
5
<script >
6
- import moment from ' moment '
6
+ import { formatDate } from ' ~/utils/article '
7
7
8
8
export default {
9
9
props: {
@@ -13,10 +13,8 @@ export default {
13
13
}
14
14
},
15
15
computed: {
16
- formettedPublishedAt () {
17
- return moment (this .publishedAt , ' X' )
18
- .locale (' ja' )
19
- .format (' L' )
16
+ formattedPublishedAt () {
17
+ return formatDate (this .publishedAt )
20
18
}
21
19
}
22
20
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" area-article-sub-infos-container" >
3
3
<div class =" article-sub-info" >
4
- 公開日:<span class =" published-at" >{{ formettedPublishedAt }}</span >
4
+ 公開日:<span class =" published-at" >{{ formattedPublishedAt }}</span >
5
5
</div >
6
6
<div class =" article-sub-info" >
7
7
獲得トークン:<span class =" token-amount" >{{ formattedTokenAmount }}</span >
11
11
12
12
<script >
13
13
import { BigNumber } from ' bignumber.js'
14
- import moment from ' moment '
14
+ import { formatDate } from ' ~/utils/article '
15
15
16
16
export default {
17
17
props: {
@@ -25,10 +25,8 @@ export default {
25
25
}
26
26
},
27
27
computed: {
28
- formettedPublishedAt () {
29
- return moment (this .createdAt , ' X' )
30
- .locale (' ja' )
31
- .format (' L' )
28
+ formattedPublishedAt () {
29
+ return formatDate (this .publishedAt )
32
30
},
33
31
formattedTokenAmount () {
34
32
if (this .tokenAmount === undefined ) return
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-undef */
2
+ import moment from 'moment'
2
3
3
4
export function getThumbnails ( images ) {
4
5
return images
@@ -33,3 +34,9 @@ export function showEmbedTweet({ $axios }) {
33
34
iframely . load ( )
34
35
} )
35
36
}
37
+
38
+ export function formatDate ( date ) {
39
+ return moment ( date , 'X' )
40
+ . locale ( 'ja' )
41
+ . format ( 'L' )
42
+ }
You can’t perform that action at this time.
0 commit comments