sentDate + date-fns format

This commit is contained in:
Jeffrey Biles
2020-03-17 13:32:21 -07:00
parent 98c669b139
commit e2498155c5
4 changed files with 15 additions and 1 deletions

View File

@@ -12,6 +12,9 @@ new Server({
},
body(){
return faker.lorem.sentence()
},
sentDate(){
return faker.date.recent(20)
}
})
},
@@ -21,6 +24,6 @@ new Server({
routes() {
this.namespace = 'api';
this.get('/emails', {timing: 2000});
this.get('/emails');
}
})

View File

@@ -9,6 +9,7 @@
},
"dependencies": {
"core-js": "^3.6.4",
"date-fns": "^2.11.0",
"vue": "^3.0.0-alpha.9"
},
"devDependencies": {

View File

@@ -8,13 +8,18 @@
<td><input type="checkbox" /></td>
<td>{{email.subject}}</td>
<td>{{email.body}}</td>
<td>{{format(new Date(email.sentDate), 'HH:MM MMM do yyyy')}}</td>
</tr>
</tbody>
</table>
</template>
<script>
import { format } from 'date-fns'
export default {
setup(){
return {format}
},
props: {
emails: {
type: Array,

View File

@@ -2628,6 +2628,11 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
date-fns@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.11.0.tgz#ec2b44977465b9dcb370021d5e6c019b19f36d06"
integrity sha512-8P1cDi8ebZyDxUyUprBXwidoEtiQAawYPGvpfb+Dg0G6JrQ+VozwOmm91xYC0vAv1+0VmLehEPb+isg4BGUFfA==
de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"