join #19

Merged
amaliadwiy merged 222 commits from join into v1 2026-02-09 11:18:03 +08:00
109 changed files with 3000 additions and 550 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);
}