坑 Dayjs 多加一天

3 min read

坑 Dayjs 多加一天

/**
 * Returns a cloned Day.js object with a specified amount of time added.
 * ```
 * dayjs().add(7, 'day')// => Dayjs
 * ```
 * Units are case insensitive, and support plural and short forms.
 *
 * Docs: https://day.js.org/docs/en/manipulate/add
 */
add(value: number, unit?: ManipulateType): Dayjs

查看接口说明add 返回的 Dayjs 对象,需要再调用其Format的转换将其转换成为 String对象