From 197a00f6ea92697c3850a8613adc86c22bdce59b Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Tue, 22 Aug 2023 10:02:42 +0800 Subject: [PATCH] docs: contributors list add last updated time (#6871) --- site/src/components/Contributors/index.vue | 41 ++++++++++++++++------ 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/site/src/components/Contributors/index.vue b/site/src/components/Contributors/index.vue index 755e47184..9f183dc9e 100644 --- a/site/src/components/Contributors/index.vue +++ b/site/src/components/Contributors/index.vue @@ -2,16 +2,22 @@ import { ref, watchEffect } from 'vue'; import { useRoute } from 'vue-router'; import { REPO_PATH } from './constants'; +import dayjs from 'dayjs'; defineProps({ isZn: Boolean, }); + const route = useRoute(); const contributors = ref([]); +const lastCommitTime = ref(0); + const filterData = data => { const arr = []; data.forEach(item => { if (!!item.author?.login || !!item.author?.html_url || !!item.author?.avatar_url) { + lastCommitTime.value = Math.max(lastCommitTime.value, +new Date(item.commit.author.date)); + arr.push({ login: item.author.login, url: item.author.html_url, @@ -46,18 +52,33 @@ watchEffect(() => {