amalia/23-okt-25 #1

Merged
amaliadwiy merged 203 commits from amalia/23-okt-25 into join 2025-10-27 11:19:44 +08:00
227 changed files with 7981 additions and 2134 deletions
Showing only changes of commit 6a97ae76fc - Show all commits

View File

@@ -1,9 +1,18 @@
import dayjs from 'dayjs';
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
import { DateType } from "react-native-ui-datepicker";
export function formatDateOnly(date?: DateType, format?: "DD-MM-YYYY" | "YYYY-MM-DD") {
if (!date) return "";
const dateObj = dayjs.isDayjs(date) ? date.toDate() : date;
const iso = new Date(dateObj).toISOString().split("T")[0];
return dayjs(iso).format(format || "DD-MM-YYYY");
}
dayjs.extend(utc);
dayjs.extend(timezone);
export function formatDateOnly(
date?: DateType,
format: "DD-MM-YYYY" | "YYYY-MM-DD" = "DD-MM-YYYY"
) {
if (!date) return "";
return dayjs(date)
.tz(dayjs.tz.guess())
.format(format);
}