Files
devops 28485d51f7
Deploy Canina / deploy (push) Successful in 4m4s
fix(blog): improve attribution layout and freshness
2026-10-20 08:41:40 +00:00

5 lines
746 B
TypeScript

export const BLOG_TEAM_FALLBACK = "پژوهش و محتوای علمی کنینا";
export function publicationDate(blog:any): string | undefined { return blog?.publishedAt || blog?.createdAt; }
export function validContentUpdatedAt(blog:any): string | undefined { const published=publicationDate(blog), updated=blog?.contentUpdatedAt; if(!published||!updated) return undefined; const p=new Date(published),u=new Date(updated); return Number.isFinite(p.getTime())&&Number.isFinite(u.getTime())&&u>p?updated:undefined; }
export function persianDate(value?:string): string { return value ? new Intl.DateTimeFormat("fa-IR-u-ca-persian", { year: "numeric", month: "numeric", day: "numeric", timeZone: "Asia/Tehran" }).format(new Date(value)) : ""; }