chore(editor): adjust format of date time in slash menu (#12631)

Closes: #12624

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Refactor**
  - Updated the time formatting to display dates as "yyyy-mm-dd hh:mm" instead of "mm-dd hh:mm".

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-05-29 07:32:35 +00:00
parent 9ec1d08d98
commit 927b4f4430

View File

@@ -95,11 +95,8 @@ export function formatDate(date: Date) {
}
export function formatTime(date: Date) {
// mm-dd hh:mm
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const strTime = `${month}-${day} ${hours}:${minutes}`;
const strTime = `${formatDate(date)} ${hours}:${minutes}`;
return strTime;
}