mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
20 lines
869 B
TypeScript
20 lines
869 B
TypeScript
export function formatDate(dateString: string) {
|
|
return new Date(`${dateString}T00:00:00Z`).toLocaleDateString("en-US", {
|
|
day: "numeric",
|
|
month: "long",
|
|
year: "numeric",
|
|
timeZone: "UTC",
|
|
});
|
|
}
|
|
|
|
export function generateManagementApiMetadata(title, methods) {
|
|
// Create a string from the methods array, formatted for title and description
|
|
const formattedMethods = methods.join(", ").replace(/, ([^,]*)$/, " or $1");
|
|
return {
|
|
title: `Formbricks ${title} API: ${
|
|
formattedMethods.charAt(0).toUpperCase() + formattedMethods.slice(1)
|
|
} ${title}`,
|
|
description: `Dive into Formbricks' ${title} API within the Public Client API suite. This API is designed for ${formattedMethods} operations on ${title}, facilitating client-side interactions without the need for authentication, thereby ensuring data privacy and efficiency.`,
|
|
};
|
|
}
|