Date.js 266 Bytes RawBlameHistoryPermalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import dayjs from 'dayjs' export function generateDate(formatStr = 'YYYY-MM-DD hh:mm:ss') { let dayDate, weekDate, monthDate, yearDate dayDate = dayjs().format(formatStr) weekDate = '' return { dayDate, weekDate, monthDate, yearDate } }