From 34bc24151ba2ca46b2b08d9cef8e3c6c866d1c0a Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 11 Jun 2021 20:06:59 +0200 Subject: Fixed BaseBreadcrumb, RepositoryTree & the log and tree views --- packages/client/src/views/Home.vue | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'packages/client/src/views/Home.vue') diff --git a/packages/client/src/views/Home.vue b/packages/client/src/views/Home.vue index 104865a..87adf4a 100644 --- a/packages/client/src/views/Home.vue +++ b/packages/client/src/views/Home.vue @@ -5,15 +5,15 @@
    -
  • -
    +
  • +
    - - {{ project_name }} + + {{ project.name }} - Last updated about {{ project["last_updated"] }} ago - {{ project["description"] }} + Last updated about {{ project.last_updated }} + {{ project.description }}
@@ -34,6 +34,7 @@ import Loading from "vue-loading-overlay"; import BaseErrorMessage from "@/components/BaseErrorMessage"; import fetchData from "@/util/fetch"; import { ref } from "vue"; +import { formatDistance } from "date-fns"; export default { name: "Home", @@ -45,12 +46,19 @@ export default { }, setup() { const projects = ref({}); - const search = ref(""); + const search = ref(null); const is_loading = ref(true); const fetch_failed = ref(null); const fetchProjects = async() => { const projects_data = await fetchData("repos", fetch_failed, is_loading, "projects"); + + projects_data.reduce((result, project) => { + project.last_updated = formatDistance(Date.parse(project.last_updated), new Date(), { addSuffix: true }); + result.push(projects); + return result; + }, []); + projects.value = projects_data; }; -- cgit v1.2.3-18-g5258