Commit 3433b281 authored by Phạm Quang Bảo's avatar Phạm Quang Bảo

[tag]0.1-vcci

parents b083c86b b5c7d30e
Pipeline #53567 passed with stages
in 2 minutes and 3 seconds
...@@ -2,11 +2,8 @@ import dayjs from "dayjs"; ...@@ -2,11 +2,8 @@ import dayjs from "dayjs";
import { Calendar, MapPin, Clock, Users, CreditCard } from "lucide-react"; import { Calendar, MapPin, Clock, Users, CreditCard } from "lucide-react";
import type { DynamicPostItem } from "@/api/vcci-news/types/post"; import type { DynamicPostItem } from "@/api/vcci-news/types/post";
const formatDate = (value: string | null) =>
value ? dayjs(value).format("DD/MM/YYYY") : "";
const formatDateTime = (value: string | null) => const formatDateTime = (value: string | null) =>
value ? dayjs(value).format("DD/MM/YYYY HH:mm") : ""; value ? dayjs(value).format("HH:mm (DD/MM/YYYY)") : "";
const isEventOrTraining = (post: DynamicPostItem) => { const isEventOrTraining = (post: DynamicPostItem) => {
const eventCategories = ["Sự kiện", "Đào tạo", "su-kien", "dao-tao", "su_kien", "dao_tao"]; const eventCategories = ["Sự kiện", "Đào tạo", "su-kien", "dao-tao", "su_kien", "dao_tao"];
...@@ -80,10 +77,10 @@ export default function EventInfoCard({ post }: { post: DynamicPostItem }) { ...@@ -80,10 +77,10 @@ export default function EventInfoCard({ post }: { post: DynamicPostItem }) {
<p className="mt-1 text-sm font-semibold text-[#1f3768]"> <p className="mt-1 text-sm font-semibold text-[#1f3768]">
{startedAt {startedAt
? endedAt ? endedAt
? `${formatDate(startedAt)} - ${formatDate(endedAt)}` ? `${formatDateTime(startedAt)} - ${formatDateTime(endedAt)}`
: formatDate(startedAt) : formatDateTime(startedAt)
: endedAt : endedAt
? formatDate(endedAt) ? formatDateTime(endedAt)
: "-"} : "-"}
</p> </p>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment