-
convertDateFormatToIntlOptions
(format)
{Intl.DateTimeFormatOptions}
将 web map date format string 转换为 Intl.DateTimeFormat 选项对象。
参数:
类型 说明 format String可选的 要转换的 web Map日期格式字符串。
可能的值:"short-date"|"short-date-short-time"|"short-date-short-time-24"|"short-date-long-time"|"short-date-long-time-24"|"long-month-day-year"|"long-month-day-year-short-time"|"long-month-day-year-short-time-24"|"long-month-day-year-long-time"|"long-month-day-year-long-time-24"|"day-short-month-year"|"day-short-month-year-short-time"|"day-short-month-year-short-time-24"|"day-short-month-year-long-time"|"day-short-month-year-long-time-24"|"long-date"|"long-date-short-time"|"long-date-short-time-24"|"long-date-long-time"|"long-date-long-time-24"|"long-month-year"|"short-month-year"|"year"|"short-time"|"long-time"
返回:
类型 说明 Intl.DateTimeFormatOptions 从 web Map规范中定义的格式字符串派生的日期格式选项。 例子:
const dateFormatIntlOptions = intl.convertDateFormatToIntlOptions("short-date-short-time"); // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#Parameters // Setting the string value 'short-date-short-time' is similar to what is set in the object below // dateFormatIntlOptions = { // day: "numeric", // month: "numeric", // year: "numeric", // hour: "numeric", // minute: "numeric" // } const now = Date.now(); // 1560375191812 const formattedDate = intl.formatDate(now, dateFormatIntlOptions); console.log(formattedDate); // expected output for US English locale: "6/12/2019, 2:33 PM"
基本信息
以下是所在类或对象的基本信息。
AMD:
require(["esri/intl"], (intl) => { /* code goes here */ });
ESM:
import * as intl from "@arcgis/core/intl";
对象:
esri/intl
自从:用于 JavaScript 4.12 的 ArcGIS API
用法说明
intl.convertDateFormatToIntlOptions
函数(或属性)的定义如下:
相关用法
- JavaScript ArcGIS intl.convertNumberFormatToIntlOptions用法及代码示例
- JavaScript ArcGIS intl.createJSONLoader用法及代码示例
- JavaScript ArcGIS intl.normalizeMessageBundleLocale用法及代码示例
- JavaScript ArcGIS intl.fetchMessageBundle用法及代码示例
- JavaScript ArcGIS intl.SubstituteOptions用法及代码示例
- JavaScript ArcGIS intl.SubstituteDateTimeFormatOptions用法及代码示例
- JavaScript ArcGIS intl.SubstituteNumberFormatOptions用法及代码示例
- JavaScript ArcGIS intl.formatNumber用法及代码示例
- JavaScript ArcGIS intl.registerMessageBundleLoader用法及代码示例
- JavaScript ArcGIS intl.setLocale用法及代码示例
- JavaScript ArcGIS intl.MessageBundleLoader用法及代码示例
- JavaScript ArcGIS intl.formatDate用法及代码示例
- JavaScript ArcGIS intl.onLocaleChange用法及代码示例
- JavaScript ArcGIS intl.substitute用法及代码示例
- JavaScript includes()用法及代码示例
- JavaScript isFinite()用法及代码示例
- JavaScript isNaN()用法及代码示例
- JavaScript ArcGIS imageService.getSamples用法及代码示例
- JavaScript ArcGIS SceneView double-click事件用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.overlaps用法及代码示例
- JavaScript ArcGIS Expand.when用法及代码示例
- JavaScript ArcGIS Sublayer.JoinTableDataSource用法及代码示例
- JavaScript ArcGIS FillSymbol3DLayer.outline用法及代码示例
- JavaScript ArcGIS Ground.loadAll用法及代码示例
- JavaScript Object valueOf()用法及代码示例
注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 intl.convertDateFormatToIntlOptions。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。