Skip to content

Commit

Permalink
Merge pull request #62 from QingdaoU/fix-contest-display
Browse files Browse the repository at this point in the history
修复 ac time 超出 24 小时显示不正确问题
  • Loading branch information
virusdefender authored Dec 17, 2019
2 parents f353097 + a52a3e2 commit 12cbf7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/store/modules/contest.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ const actions = {
return new Promise((resolve, reject) => {
api.getContestProblemList(rootState.route.params.contestID).then(res => {
res.data.data.sort((a, b) => {
return a._id > b._id
if (a._id === b._id) {
return 0
} else if (a._id > b._id) {
return 1
}
return -1
})
commit(types.CHANGE_CONTEST_PROBLEMS, {contestProblems: res.data.data})
resolve(res)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function duration (startTime, endTime) {

function secondFormat (seconds) {
let m = moment.duration(seconds, 'seconds')
return m.hours() + ':' + m.minutes() + ':' + m.seconds()
return Math.floor(m.asHours()) + ':' + m.minutes() + ':' + m.seconds()
}

export default {
Expand Down

0 comments on commit 12cbf7f

Please sign in to comment.