Skip to content

Home > sculp-js > CalculateDateOptions

CalculateDateOptions interface

Signature:

typescript
export interface CalculateDateOptions

Properties

Property

Modifiers

Type

Description

days?

number

(Optional) 天数(正数表示向后,负数表示向前) 0

format?

string

(Optional) 输出格式模板(传递给 formatDate 函数处理) 支持以下占位符: - YYYY/yyyy: 4 位年份 - YY/yy: 2 位年份 - MM: 2 位月份 - M: 不补零月份 - DD/dd: 2 位日期 - D/d: 不补零日期 - HH: 2 位小时 (24 小时制) - H: 不补零小时 - mm: 2 位分钟 - m: 不补零分钟 - ss: 2 位秒 - s: 不补零秒 - SSS: 3 位毫秒 - SS: 2 位毫秒 - S: 1 位毫秒 - ww/w: 中文星期 'YYYY-MM-DD'

hours?

number

(Optional) 小时数(正数表示向后,负数表示向前) 0

milliseconds?

number

(Optional) 毫秒数(正数表示向后,负数表示向前) 0

minutes?

number

(Optional) 分钟数(正数表示向后,负数表示向前) 0

months?

number

(Optional) 月数(正数表示向后,负数表示向前) 0

returnDate?

boolean

(Optional) 是否返回 Date 对象而非字符串 false

seconds?

number

(Optional) 秒数(正数表示向后,负数表示向前) 0

weeks?

number

(Optional) 周数(正数表示向后,负数表示向前) 0

years?

number

(Optional) 年数(正数表示向后,负数表示向前) 0

Released under the MIT License.