Added showing date on detail page
the build failed Details

This commit is contained in:
konrad 2017-11-30 15:26:28 +01:00 committed by kolaente
parent c3d6032bcf
commit 634e696369
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
8 changed files with 130 additions and 8 deletions

View File

@ -89,4 +89,8 @@ export default {
.lang-switcher{
float: right;
}
.grey{
color: #ccc;
}
</style>

View File

@ -15,6 +15,11 @@
</router-link>
<list :infos="authorList"/>
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.author.created !== this.author.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div>
</div>
</template>
@ -30,7 +35,15 @@
user: auth.user,
author: {},
authorID: this.$route.params.id,
authorList: []
authorList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
}
},
created () {
@ -60,11 +73,27 @@
}
]
// Beautify the date
let c = new Date(this.author.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.author.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false
})
.catch(e => {
this.loading = false
// Build the notification text from error response
console.log(e)
let err = e.message
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message

View File

@ -15,6 +15,11 @@
</router-link>
<list :infos="bookList" />
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.book.created !== this.book.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div>
</div>
</template>
@ -33,7 +38,15 @@
allStatus: [],
bookID: this.$route.params.id,
bookList: {},
AuthorList: []
AuthorList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
}
},
created () {
@ -82,7 +95,6 @@
// Make Status a name, not an id
this.book.status = this.getStatusByID(this.book.status)
this.loading = false
// Build the list object
this.bookList = [
@ -125,6 +137,23 @@
content: this.AuthorList
}
]
// Beautify the date
let c = new Date(this.book.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.book.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false
})
.catch(e => {
this.loading = false

View File

@ -15,6 +15,10 @@
</router-link>
<list :infos="itemList"/>
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.item.created !== this.item.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div>
</div>
</template>
@ -30,7 +34,15 @@
user: auth.user,
item: {},
itemID: this.$route.params.id,
itemList: []
itemList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
}
},
created () {
@ -68,6 +80,21 @@
}
]
// Beautify the date
let c = new Date(this.item.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.item.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false
})
.catch(e => {

View File

@ -14,6 +14,10 @@
</router-link>
<list :infos="publisherList"/>
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.publisher.created !== this.publisher.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div>
</div>
</template>
@ -29,7 +33,15 @@
user: auth.user,
publisher: {},
publisherID: this.$route.params.id,
publisherList: []
publisherList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
}
},
created () {
@ -55,6 +67,21 @@
}
]
// Beautify the date
let c = new Date(this.publisher.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.publisher.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false
})
.catch(e => {

View File

@ -14,7 +14,9 @@ export default {
submit: 'Senden',
selectOne: 'Wähle einen aus',
selectOneOrMore: 'Wähle einen oder mehr',
name: 'Name'
name: 'Name',
created: 'Erstellt am {date} um {time}',
lastEdit: 'Zuletzt bearbeitet am {date} um {time}'
},
login: {
title: 'Einloggen',

View File

@ -14,7 +14,9 @@ export default {
submit: 'Submit',
selectOne: 'Select one',
selectOneOrMore: 'Select one or more',
name: 'Name'
name: 'Name',
created: 'Created on {date} at {time}',
lastEdit: 'Last edit on {date} at {time}'
},
login: {
title: 'Login',

View File

@ -14,7 +14,9 @@ export default {
submit: 'Envoyer',
selectOne: 'Choisissez un',
selectOneOrMore: 'Choisissez un ou plus',
name: 'Nom'
name: 'Nom',
created: 'Crée le {date} à {time}',
lastEdit: 'Dernière motification le {date} à {time}'
},
login: {
title: 'Se connecter',