export function formatBlogDate(date: Date) {
    return date.toISOString().split("T")[0];
}

export function slugifyTag(tag: string) {
    return tag
        .toLowerCase()
        .trim()
        .replace(/&/g, " and ")
        .replace(/[^a-z0-9\s-]/g, "")
        .replace(/\s+/g, "-")
        .replace(/-+/g, "-");
}

export function getTagHref(tag: string) {
    return `/blog/tag/${slugifyTag(tag)}`;
}
