文件操作 - getRelativeTimeString.ts
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/give/src/Admin/common/getRelativeTimeString.ts
编辑文件内容
import {humanTimeDiff, getDate} from '@wordpress/date'; /** * Returns a relative time string for a given date (e.g. "Today" or "2 days ago") * * @since 4.13.0 updated to use the @wordpress/date functions * @since 4.10.0 */ export function getRelativeTimeString(date: Date): string { const now = getDate(new Date().toISOString()); return humanTimeDiff(date, now); }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件