Merge pull request #77 from KevinMidboe/fix/personal-highscore-days-ago
No longer shows "0 days ago", instead human string.
This commit is contained in:
		| @@ -28,7 +28,7 @@ | |||||||
|  |  | ||||||
|         <div v-for="win in winner.wins" :key="win._id"> |         <div v-for="win in winner.wins" :key="win._id"> | ||||||
|           <router-link :to="winDateUrl(win.date)" class="days-ago"> |           <router-link :to="winDateUrl(win.date)" class="days-ago"> | ||||||
|             {{ humanReadableDate(win.date) }} - {{ daysAgo(win.date) }} dager siden |             {{ humanReadableDate(win.date) }} - {{ daysAgo(win.date) }} | ||||||
|           </router-link> |           </router-link> | ||||||
|  |  | ||||||
|           <div class="won-wine" v-if="win.wine"> |           <div class="won-wine" v-if="win.wine"> | ||||||
| @@ -133,7 +133,14 @@ export default { | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     humanReadableDate: humanReadableDate, |     humanReadableDate: humanReadableDate, | ||||||
|     daysAgo: daysAgo |     daysAgo(date) { | ||||||
|  |       const days = daysAgo(date); | ||||||
|  |       if (days == 0) { | ||||||
|  |         return "i dag"; | ||||||
|  |       } else { | ||||||
|  |         return `${days} dager siden`; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user