Skip to content

vue-i18n / general / DateTimeOptions

接口: DateTimeOptions<Key, Locales>

日期时间选项

备注

日期时间格式化 API 的选项

Vue I18n General

扩展

  • DateTimeFormatOptions.LocaleOptions<Locales>

类型参数

类型参数默认类型
Keystring
LocalesLocale

属性

calendar?

ts
optional calendar: string;

继承自

ts
Intl.DateTimeFormatOptions.calendar

dateStyle?

ts
optional dateStyle: "long" | "short" | "full" | "medium";

继承自

ts
Intl.DateTimeFormatOptions.dateStyle

day?

ts
optional day: "numeric" | "2-digit";

继承自

ts
Intl.DateTimeFormatOptions.day

dayPeriod?

ts
optional dayPeriod: "long" | "short" | "narrow";

继承自

ts
Intl.DateTimeFormatOptions.dayPeriod

era?

ts
optional era: "long" | "short" | "narrow";

继承自

ts
Intl.DateTimeFormatOptions.era

fallbackWarn?

ts
optional fallbackWarn: boolean;

备注

当语言缺少针对某个键的格式化时是否进行解析


formatMatcher?

ts
optional formatMatcher: "best fit" | "basic";

继承自

ts
Intl.DateTimeFormatOptions.formatMatcher

fractionalSecondDigits?

ts
optional fractionalSecondDigits: 1 | 2 | 3;

继承自

ts
Intl.DateTimeFormatOptions.fractionalSecondDigits

hour?

ts
optional hour: "numeric" | "2-digit";

继承自

ts
Intl.DateTimeFormatOptions.hour

hour12?

ts
optional hour12: boolean;

继承自

ts
Intl.DateTimeFormatOptions.hour12

hourCycle?

ts
optional hourCycle: "h11" | "h12" | "h23" | "h24";

继承自

ts
Intl.DateTimeFormatOptions.hourCycle

key?

ts
optional key: Key;

备注

目标格式键


locale?

ts
optional locale: LocaleDetector<any[]> | Locales;

备注

本地化区域设置

继承自

ts
LocaleOptions.locale

localeMatcher?

ts
optional localeMatcher: "lookup" | "best fit";

继承自

ts
Intl.DateTimeFormatOptions.localeMatcher

minute?

ts
optional minute: "numeric" | "2-digit";

继承自

ts
Intl.DateTimeFormatOptions.minute

missingWarn?

ts
optional missingWarn: boolean;

备注

当本地化失败时是否抑制警告输出


month?

ts
optional month: "long" | "short" | "narrow" | "numeric" | "2-digit";

继承自

ts
Intl.DateTimeFormatOptions.month

numberingSystem?

ts
optional numberingSystem: string;

继承自

ts
Intl.DateTimeFormatOptions.numberingSystem

part?

ts
optional part: boolean;

备注

是否使用 Intl.DateTimeFormat#formatToParts


second?

ts
optional second: "numeric" | "2-digit";

继承自

ts
Intl.DateTimeFormatOptions.second

timeStyle?

ts
optional timeStyle: "long" | "short" | "full" | "medium";

继承自

ts
Intl.DateTimeFormatOptions.timeStyle

timeZone?

ts
optional timeZone: string;

继承自

ts
Intl.DateTimeFormatOptions.timeZone

timeZoneName?

ts
optional timeZoneName:
  | "long"
  | "short"
  | "shortOffset"
  | "longOffset"
  | "shortGeneric"
  | "longGeneric";

继承自

ts
Intl.DateTimeFormatOptions.timeZoneName

weekday?

ts
optional weekday: "long" | "short" | "narrow";

继承自

ts
Intl.DateTimeFormatOptions.weekday

year?

ts
optional year: "numeric" | "2-digit";

继承自

ts
Intl.DateTimeFormatOptions.year