add payment, trust badge, handle race condition, fix booking schema
This commit is contained in:
@@ -9,6 +9,10 @@ export const LIMITS = {
|
||||
MAX_MOUNTAIN_LENGTH: 100,
|
||||
MAX_LOCATION_LENGTH: 120,
|
||||
MAX_DESCRIPTION_LENGTH: 5000,
|
||||
/** Meeting point & tiap blok include/exclude */
|
||||
MAX_MEETING_POINT_LENGTH: 500,
|
||||
MAX_TRIP_ITINERARY_LENGTH: 8000,
|
||||
MAX_TRIP_BULLET_SECTION_LENGTH: 4000,
|
||||
MAX_REVIEW_COMMENT: 500,
|
||||
MAX_IMAGE_URLS: 5,
|
||||
MAX_URL_LENGTH: 2048,
|
||||
|
||||
@@ -81,3 +81,30 @@ export function isPastTripLastDayForReview(
|
||||
);
|
||||
return Date.now() > endMs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tampilkan tanggal trip untuk UI: pakai **kalender UTC** (sama dengan
|
||||
* `tripStoredInstantFromYmd` & filter Open Trip), supaya tidak bergeser
|
||||
* karena timezone runtime (server vs browser).
|
||||
*/
|
||||
export function formatTripCalendarDateLong(
|
||||
d: Date | string,
|
||||
locale = "id-ID"
|
||||
): string {
|
||||
const date = typeof d === "string" ? new Date(d) : d;
|
||||
return new Intl.DateTimeFormat(locale, {
|
||||
dateStyle: "long",
|
||||
timeZone: "UTC",
|
||||
}).format(date);
|
||||
}
|
||||
|
||||
export function formatTripCalendarDateRangeLong(
|
||||
start: Date | string,
|
||||
end?: Date | string | null,
|
||||
locale = "id-ID"
|
||||
): string {
|
||||
const startStr = formatTripCalendarDateLong(start, locale);
|
||||
if (!end) return startStr;
|
||||
const endStr = formatTripCalendarDateLong(end, locale);
|
||||
return `${startStr} — ${endStr}`;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/** Minimal trip sebagai organizer untuk badge "Trip leader" (heuristik MVP). */
|
||||
export const TRIP_LEADER_MIN_TRIPS = 2;
|
||||
Reference in New Issue
Block a user