Admin and Gallery and event change

This commit is contained in:
2026-09-24 12:29:46 +05:30
parent a91b957579
commit aea69de410
27 changed files with 1815 additions and 126 deletions
+24
View File
@@ -0,0 +1,24 @@
// Date helpers shared by the site and the admin panel (no server-only imports).
import type { MeetingItem } from "./content";
/** Today's date in India as YYYY-MM-DD. */
export function todayIST() {
return new Date().toLocaleDateString("en-CA", { timeZone: "Asia/Kolkata" });
}
/** The next meeting on or after today, if any. */
export function getNextMeeting(list: MeetingItem[]): MeetingItem | undefined {
const today = todayIST();
return [...list].filter((m) => m.date >= today).sort((a, b) => a.date.localeCompare(b.date))[0];
}
export function formatMeetingDate(date: string) {
const [y, m, d] = date.split("-").map(Number);
return new Date(Date.UTC(y, m - 1, d)).toLocaleDateString("en-IN", {
weekday: "short",
day: "numeric",
month: "short",
year: "numeric",
timeZone: "UTC",
});
}