CLASSROOMIO-T-108: Add grading score to Graded column

This commit is contained in:
Rotimi Best
2023-10-02 04:15:01 +01:00
parent 21305c5d65
commit 93f674b04b
8 changed files with 48 additions and 41 deletions
@@ -1,8 +1,6 @@
<script>
import { marked } from 'marked';
import dayjs from 'dayjs';
import pluralize from 'pluralize';
import relativeTime from 'dayjs/plugin/relativeTime';
import TrashCanIcon from 'carbon-icons-svelte/lib/TrashCan.svelte';
import { SkeletonPlaceholder, SkeletonText } from 'carbon-components-svelte';
import ArrowLeftIcon from 'carbon-icons-svelte/lib/ArrowLeft.svelte';
@@ -23,8 +21,7 @@
import TextField from '$lib/components/Form/TextField.svelte';
import DeleteCommentModal from '$lib/components/Org/Community/DeleteCommentModal.svelte';
import TextEditor from '$lib/components/TextEditor/index.svelte';
dayjs.extend(relativeTime);
import { calDateDiff } from '$lib/utils/functions/date';
export let data;
const { slug } = data;
@@ -58,7 +55,7 @@
avatar: data?.author?.profile?.avatar_url || ''
},
body: data.body,
createdAt: dayjs(data.created_at).fromNow(true),
createdAt: calDateDiff(data.created_at),
comments: data.comments.map((c) => ({
id: c.id,
authorId: c.author?.profile?.id || '',
@@ -66,7 +63,7 @@
avatar: c.author?.profile?.avatar_url || '',
votes: c.votes,
comment: c.body,
createdAt: dayjs(c.created_at).fromNow(true)
createdAt: calDateDiff(c.created_at)
})),
totalComments: 0
};
@@ -147,7 +144,7 @@
avatar: $profile?.avatar_url || '',
votes: 0,
comment: _c.body,
createdAt: dayjs(_c.created_at).fromNow(true)
createdAt: calDateDiff(_c.created_at)
}
];