chore: replace dayjs with moment as date library

Moment.js provides more extensive date manipulation features compared to dayjs, which better suits our current requirements for complex date handling.
This commit is contained in:
2025-09-15 19:52:26 +08:00
parent 4fe44a3254
commit 2a1a9829d4
3 changed files with 9 additions and 32 deletions
-23
View File
@@ -1,23 +0,0 @@
import dayjs from "dayjs"
import duration from "dayjs/plugin/duration"
dayjs.extend(duration)
/**
* Dayjs with `Duration` plugin.
*/
export default dayjs
/**
* Formats a given datetime string into a standardised "YYYY-MM-DD HH:mm:ss" format.
*
* This function utilises the [dayjs](https://day.js.org/) library for parsing and formatting.
*
* @param {string} datetime the datetime string to format
* @returns {string} the formatted datetime string in `YYYY-MM-DD HH:mm:ss` format
*/
function formatDatetime (datetime: string): string {
return dayjs(datetime).format("YYYY-MM-DD HH:mm:ss")
}
export { formatDatetime }