import CONFIG from '../config' import { siteConfig } from '@/lib/config' /** * 博客统计卡牌 * @param {*} props * @returns */ export function AnalyticsCard(props) { const targetDate = new Date(siteConfig('HEO_SITE_CREATE_TIME', null, CONFIG)) const today = new Date() const diffTime = today.getTime() - targetDate.getTime() // 获取两个日期之间的毫秒数差值 const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) // 将毫秒数差值转换为天数差值 const { postCount } = props return <>
文章数:
{postCount}
建站天数:
{diffDays} 天
访问量:
访客数:
}