Skip to content

Commit

Permalink
v1.6.14 - Feature/notification center time (#171)
Browse files Browse the repository at this point in the history
* add date and month in notification center message
  • Loading branch information
yumiguan authored Jul 5, 2019
1 parent f2de104 commit bf58777
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
16 changes: 9 additions & 7 deletions frontend/src/views/notice/NotRemindMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<Card shadow @mouseover.native="isDisplayDate=false" @mouseout.native="isDisplayDate=true" @click.native="jump(notice)" style="cursor:pointer">
<p slot="title" style="line-height:16px">
<Row>
<Col span="20">
<Col span="16">
<div :title="notice.sender.file">
<span style="display:inline-block;max-width:270px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">
{{notice.sender.file}}
</span>
<Badge v-if="notice.count > 1" :count="notice.count" class-name="notice-badge-gray" style="padding-left:5px"></Badge>
</div>
</Col>
<Col span="4" align="right">
<Col span="8" align="right">
<div v-if="isDisplayDate">
<p style="font-weight:400;font-size:12px">
{{timestampToTime(notice.timestamp)}}
Expand Down Expand Up @@ -51,11 +51,13 @@ export default {
},
methods: {
timestampToTime(timeStamp){
let date = new Date(timeStamp * 1000)
let hour = date.getHours() + ':'
let minute = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':'
let second = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds())
return hour + minute + second
let dateObj = new Date(timeStamp * 1000)
let month = dateObj.getMonth()+1
let date = dateObj.getDate()
let hour = dateObj.getHours()
let minute = (dateObj.getMinutes() < 10 ? '0'+dateObj.getMinutes() : dateObj.getMinutes())
let second = (dateObj.getSeconds() < 10 ? '0'+dateObj.getSeconds() : dateObj.getSeconds())
return month + '/' + date + ' ' + hour + ':' + minute + ':' + second
},
deleteNotice(noticeKey){
this.$store.dispatch('deleteNotRemind', noticeKey)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/notice/NoticeCenter.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="main-header-notice" @click="drawerIsCollapsed=true">
<a>
<Badge :count="noticeList.length" :offset="offset" class-name="notice-badge">
<Badge :count="noticeList.length" overflow-count="999" :offset="offset" class-name="notice-badge">
<Icon type="ios-notifications" size="16" color="white" ></Icon>
</Badge>
</a>
Expand Down Expand Up @@ -49,7 +49,7 @@ export default {
},
data() {
return {
offset: [15, 2],
offset: [15, 4],
selectedTab : "Notifications",
tabList : ["Notifications", "NotRemind"],
count: 0,
Expand Down
16 changes: 9 additions & 7 deletions frontend/src/views/notice/NoticeMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<Card shadow @mouseover.native="isDisplayDate=false" @mouseout.native="isDisplayDate=true" @click.native="jump(notice)" style="cursor:pointer">
<p slot="title" style="line-height:16px">
<Row>
<Col span="20">
<Col span="16">
<div :title="notice.sender.file">
<span style="display:inline-block;max-width:270px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">
{{notice.sender.file}}
</span>
<Badge v-if="notice.count > 1" :count="notice.count" class-name="notice-badge" style="padding-left:5px"></Badge>
</div>
</Col>
<Col span="4" align="right">
<Col span="8" align="right">
<div v-if="isDisplayDate">
<p style="font-weight:400;font-size:12px">
{{timestampToTime(notice.timestamp)}}
Expand Down Expand Up @@ -51,11 +51,13 @@ export default {
},
methods: {
timestampToTime(timeStamp){
let date = new Date(timeStamp * 1000)
let hour = date.getHours() + ':'
let minute = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':'
let second = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds())
return hour + minute + second
let dateObj = new Date(timeStamp * 1000)
let month = dateObj.getMonth()+1
let date = dateObj.getDate()
let hour = dateObj.getHours()
let minute = (dateObj.getMinutes() < 10 ? '0'+dateObj.getMinutes() : dateObj.getMinutes())
let second = (dateObj.getSeconds() < 10 ? '0'+dateObj.getSeconds() : dateObj.getSeconds())
return month + '/' + date + ' ' + hour + ':' + minute + ':' + second
},
deleteNotice(noticeKey){
this.$store.dispatch('deleteNotice', noticeKey)
Expand Down
2 changes: 1 addition & 1 deletion lyrebird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
IVERSION = (1, 6, 13)
IVERSION = (1, 6, 14)
VERSION = ".".join(str(i) for i in IVERSION)
LYREBIRD = "Lyrebird " + VERSION

0 comments on commit bf58777

Please sign in to comment.