修改发布日历

This commit is contained in:
筱野
2025-08-30 22:25:39 +08:00
parent bb6ec8c183
commit fe14e01267
59 changed files with 2151 additions and 2921 deletions

View File

@@ -21,6 +21,9 @@ export const getEndTime = (startTime: string): string => {
return endDateTime.format('YYYY-MM-DD HH:mm')
}
export const getDateStr = (date: Date): string => {
return dayjs(date).format('YYYY-MM-DD HH:mm')
}
export const getDate = (date: string): string => {
return dayjs(date).format('YYYY年MM月DD日')
@@ -32,10 +35,10 @@ export const getTime = (time: string): string => {
const minute = timeObj.minute()
// 判断是上午还是下午
const period = hour < 12 ? 'AM' : 'PM'
const period = hour <= 12 ? 'AM' : 'PM'
// 转换为12小时制
const hour12 = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour
const hour12 = hour === 0 ? 0 : hour > 12 ? hour - 12 : hour
// 格式化分钟,保证两位数
const minuteStr = minute.toString().padStart(2, '0')