From 4a27f5718a8ab97c27690bebb27c7b836e5bd529 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 13 Jul 2021 03:08:55 +0900 Subject: Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat を更新 (#1510) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - conflicting 版は prototype オブジェクトのためのものなので削除 - 2021/07/04 時点の英語版に同期 --- files/ja/_redirects.txt | 4 +- files/ja/_wikihistory.json | 8 +- .../global_objects/intl/datetimeformat/index.html | 87 --------------------- .../global_objects/intl/datetimeformat/index.html | 89 ++++++++++------------ 4 files changed, 44 insertions(+), 144 deletions(-) delete mode 100644 files/ja/conflicting/web/javascript/reference/global_objects/intl/datetimeformat/index.html diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 54ec3fdc1d..b047db7704 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -4938,7 +4938,7 @@ /ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/format /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format /ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatRange /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange /ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts -/ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/prototype /ja/docs/conflicting/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat +/ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat /ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/resolvedOptions /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions /ja/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/supportedLocalesOf /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf /ja/docs/Web/JavaScript/Reference/Global_Objects/DisplayNames /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames @@ -4954,7 +4954,7 @@ /ja/docs/Web/JavaScript/Reference/Global_Objects/Int8Array_temp /ja/docs/Web/JavaScript/Reference/Global_objects/Int8Array /ja/docs/Web/JavaScript/Reference/Global_Objects/InternalError/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/InternalError /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator -/ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/prototype /ja/docs/conflicting/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat +/ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/prototype /ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index 6f5f7185f3..13ecfd40e7 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -48611,12 +48611,10 @@ "Kohei" ] }, - "conflicting/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat": { - "modified": "2020-10-15T21:36:10.939Z", + "conflicting/Web/HTTP/Headers/X-DNS-Prefetch-Control": { + "modified": "2019-03-24T00:00:27.042Z", "contributors": [ - "fscholz", - "mfuji09", - "shide55" + "RobinEgg" ] }, "conflicting/Web/JavaScript/Reference/Global_Objects/JSON": { diff --git a/files/ja/conflicting/web/javascript/reference/global_objects/intl/datetimeformat/index.html b/files/ja/conflicting/web/javascript/reference/global_objects/intl/datetimeformat/index.html deleted file mode 100644 index cc053d7a2f..0000000000 --- a/files/ja/conflicting/web/javascript/reference/global_objects/intl/datetimeformat/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: Intl.DateTimeFormat.prototype -slug: conflicting/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat -tags: - - DateTimeFormat - - Internationalization - - JavaScript - - Property - - Prototype -translation_of: Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat -translation_of_original: Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/prototype -original_slug: Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/prototype ---- -
{{JSRef}}
- -

Intl.DateTimeFormat.prototype プロパティは、 {{jsxref("Global_Objects/DateTimeFormat", "Intl.DateTimeFormat")}} コンストラクターに対するプロトタイプオブジェクトを表します。

- -
{{js_property_attributes(0, 0, 0)}}
- -

解説

- -

Intl.DateTimeFormat インスタンスの解説については {{jsxref("DateTimeFormat")}} を確認して下さい。

- -

{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}} インスタンスは Intl.DateTimeFormat.prototype から継承します。プロトタイプオブジェクトへの変更はすべての {{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}} インスタンスによって継承されます。

- -

プロパティ

- -
-
Intl.DateTimeFormat.prototype.constructor
-
{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}} への参照です。
-
- -

メソッド

- -
-
{{jsxref("DateTimeFormat.format", "Intl.DateTimeFormat.prototype.format()")}}
-
ロケールおよびこの {{jsxref("DateTimeFormat", "DateTimeFormat")}} オブジェクトの書式化オプションに則って日付を書式化するゲッター関数です。
-
{{jsxref("DateTimeFormat.formatToParts", "Intl.DateTimeFormat.prototype.formatToParts()")}}
-
Returns an {{jsxref("Array")}} of objects representing the date string in parts that can be used for custom locale-aware formatting.
-
{{jsxref("DateTimeFormat.resolvedOptions", "Intl.DateTimeFormat.prototype.resolvedOptions()")}}
-
ローケルを反映しているプロパティとオブジェクトの初期化中に計算されたオプションをもった新しいオブジェクトを返します。
-
{{jsxref("DateTimeFormat.formatRange", "Intl.DateTimeFormat.prototype.formatRange()")}}
-
This method receives two Dates and formats the date range in the most concise way based on the locale and options provided when instantiating {{jsxref("DateTimeFormat", "DateTimeFormat")}}.
-
{{jsxref("DateTimeFormat.formatRangeToParts", "Intl.DateTimeFormat.prototype.formatRangeToParts()")}}
-
This method receives two Dates and returns an Array of objects containing the locale-specific tokens representing each part of the formatted date range.
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('ES Int Draft', '#sec-Intl.DateTimeFormat.prototype', 'Intl.DateTimeFormat.prototype')}}{{Spec2('ES Int Draft')}}
{{SpecName('ES Int 2.0', '#sec-12.2.1', 'Intl.DateTimeFormat.prototype')}}{{Spec2('ES Int 2.0')}}
{{SpecName('ES Int 1.0', '#sec-12.2.1', 'Intl.DateTimeFormat.prototype')}}{{Spec2('ES Int 1.0')}}初回定義
- -

ブラウザーの互換性

- -
-

{{Compat("javascript.builtins.Intl.DateTimeFormat.prototype")}}

-
- -

関連情報

- - diff --git a/files/ja/web/javascript/reference/global_objects/intl/datetimeformat/index.html b/files/ja/web/javascript/reference/global_objects/intl/datetimeformat/index.html index 9b8b7c8a13..9b18a60a81 100644 --- a/files/ja/web/javascript/reference/global_objects/intl/datetimeformat/index.html +++ b/files/ja/web/javascript/reference/global_objects/intl/datetimeformat/index.html @@ -7,53 +7,53 @@ tags: - Internationalization - Intl - JavaScript + - Localization - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat +browser-compat: javascript.builtins.Intl.DateTimeFormat ---
{{JSRef}}
-

Intl.DateTimeFormat オブジェクトは、言語に応じた日付と時刻の書式化を可能にするオブジェクトのためのコンストラクターです。

+

Intl.DateTimeFormat オブジェクトは、言語に応じた日付と時刻の書式化を可能にするオブジェクトのためのコンストラクターです。

{{EmbedInteractiveExample("pages/js/intl-datetimeformat.html")}}
- - -

コンストラクター

+

コンストラクター

-
{{jsxref("Intl/DateTimeFormat/DateTimeFormat", "Intl.DateTimeFormat()")}}
-
新しい DateTimeFormat オブジェクトを生成します。
+
{{jsxref("Intl/DateTimeFormat/DateTimeFormat", "Intl.DateTimeFormat()")}}
+
新しい DateTimeFormat オブジェクトを生成します。
-

静的メソッド

+

静的メソッド

-
{{jsxref("DateTimeFormat.supportedLocalesOf", "Intl.DateTimeFormat.supportedLocalesOf()")}}
-
指定されたロケールのうち、実行時の既定のロケールにフォールバックせずに対応されるものを配列に収めて返します。
+
{{jsxref("Intl/DateTimeFormat/supportedLocalesOf", "Intl.DateTimeFormat.supportedLocalesOf()")}}
+
指定されたロケールのうち、実行時の既定のロケールにフォールバックせずに対応されるものを配列に収めて返します。
-

インスタンスメソッド

+

インスタンスメソッド

-
{{jsxref("DateTimeFormat.format", "Intl.DateTimeFormat.prototype.format()")}}
-
ロケールおよびこの {{jsxref("DateTimeFormat", "DateTimeFormat")}} オブジェクトの書式化オプションに則って日付を書式化するゲッター関数です。
-
{{jsxref("DateTimeFormat.formatToParts", "Intl.DateTimeFormat.prototype.formatToParts()")}}
-
オブジェクトの {{jsxref("Array")}} を返し、これは専用のロケールを意識した書式で使用することができる部品内の数値文字列を表します。
-
{{jsxref("DateTimeFormat.resolvedOptions", "Intl.DateTimeFormat.prototype.resolvedOptions()")}}
-
ローケルを反映しているプロパティとオブジェクトの初期化中に計算された照合オプションをもった新しいオブジェクトを返します。
-
{{jsxref("DateTimeFormat.formatRange", "Intl.DateTimeFormat.prototype.formatRange()")}}
-
このメソッドは2つの Date を受け取り、 {{jsxref("DateTimeFormat", "DateTimeFormat")}} インスタンスを生成する際に指定されたロケールとオプションに基づいて、最も簡潔な方法で日付の範囲を書式化します。
-
{{jsxref("DateTimeFormat.formatRangeToParts", "Intl.DateTimeFormat.prototype.formatRangeToParts()")}}
-
このメソッドは2つの Date を受け取り、書式化された日付の範囲の各部分を表すロケール固有のトークンを含むオブジェクトの配列を返します。
+
{{jsxref("Intl/DateTimeFormat/format", "Intl.DateTimeFormat.prototype.format()")}}
+
ロケールおよびこの {{jsxref("Intl/DateTimeFormat", "DateTimeFormat")}} オブジェクトの書式化オプションに則って日付を書式化するゲッター関数です。
+
{{jsxref("Intl/DateTimeFormat/formatToParts", "Intl.DateTimeFormat.prototype.formatToParts()")}}
+
オブジェクトの {{jsxref("Array")}} を返し、これは専用のロケールを意識した書式で使用することができる部品内の数値文字列を表します。
+
{{jsxref("Intl/DateTimeFormat/resolvedOptions", "Intl.DateTimeFormat.prototype.resolvedOptions()")}}
+
ローケルを反映しているプロパティとオブジェクトの初期化中に計算された照合オプションをもった新しいオブジェクトを返します。
+
{{jsxref("Intl/DateTimeFormat/formatRange", "Intl.DateTimeFormat.prototype.formatRange()")}}
+
このメソッドは 2 つの Date を受け取り、 {{jsxref("Intl/DateTimeFormat", "DateTimeFormat")}} インスタンスを生成する際に指定されたロケールとオプションに基づいて、最も簡潔な方法で日付の範囲を書式化します。
+
{{jsxref("Intl/DateTimeFormat/formatRangeToParts", "Intl.DateTimeFormat.prototype.formatRangeToParts()")}}
+
このメソッドは 2 つの Date を受け取り、書式化された日付の範囲の各部分を表すロケール固有のトークンを含むオブジェクトの配列を返します。
-

+

-

DateTimeFormat の使用

+

DateTimeFormat の使用

基本的に、ロケールを指定せずに使用すると、 DateTimeFormat は既定のロケールとオプションを使用します。

-
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
+
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
 
 // toLocaleString without arguments depends on the implementation,
 // the default locale, and the default time zone
@@ -61,11 +61,11 @@ console.log(new Intl.DateTimeFormat().format(date));
 // → "12/19/2012" if run with en-US locale (language) and time zone America/Los_Angeles (UTC-0800)
 
-

locales の使用

+

locales の使用

この例では、ローカライズされた日付と時刻の形式のバリエーションの一部示しています。アプリケーションのユーザーインターフェイスで使用される言語のフォーマットを取得するには、 locales 引数を使用して、その言語 (およびおそらくいくつかのフォールバック言語) を指定してください。

-
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
+
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
 
 // Results below use the time zone of America/Los_Angeles (UTC-0800, Pacific Standard Time)
 
@@ -96,11 +96,11 @@ console.log(new Intl.DateTimeFormat(['ban', 'id']).format(date));
 // → "19/12/2012"
 
-

options の使用

+

options の使用

日付と時刻の書式は options 引数を使用してカスタマイズできます。

-
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0, 200));
+
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0, 200));
 
 // request a weekday along with a long date
 var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
@@ -123,11 +123,10 @@ console.log(new Intl.DateTimeFormat('en-AU', options).format(date));
 // → "2:00:00 pm AEDT"
 
 // sometimes you want to be very precise
-options.fractionalSecondDigits = 3;
+options.fractionalSecondDigits = 3; //number digits for fraction-of-seconds
 console.log(new Intl.DateTimeFormat('en-AU', options).format(date));
 // → "2:00:00.200 pm AEDT"
 
-
 // sometimes even the US needs 24-hour time
 options = {
   year: 'numeric', month: 'numeric', day: 'numeric',
@@ -138,7 +137,6 @@ options = {
 console.log(new Intl.DateTimeFormat('en-US', options).format(date));
 // → "12/19/2012, 19:00:00"
 
-
 // to specify options but use the browser's default locale, use 'default'
 console.log(new Intl.DateTimeFormat('default', options).format(date));
 // → "12/19/2012, 19:00:00"
@@ -151,7 +149,7 @@ console.log(new Intl.DateTimeFormat('en-US', options).format(date));
 
 

The used calendar and numbering formats can also be set independently via options arguments:

-
var options = {calendar: 'chinese', numberingSystem: 'arab'};
+
var options = {calendar: 'chinese', numberingSystem: 'arab'};
 var dateFormat = new Intl.DateTimeFormat('default', options);
 var usedOptions = dateFormat.resolvedOptions();
 
@@ -165,29 +163,20 @@ console.log(usedOptions.timeZone);
 // → "America/New_York" (the users default timezone)
 
-

仕様書

+

ポリフィル

+ +

formatjs Intl.DateTimeFormat polyfill

+ +

仕様書

- - - - - - - - - - - -
仕様書
{{SpecName('ES Int Draft', '#datetimeformat-objects', 'Intl.DateTimeFormat')}}
+{{Specifications}} -

ブラウザーの互換性

+

ブラウザーの互換性

-
-

{{Compat("javascript.builtins.Intl.DateTimeFormat")}}

-
+
{{Compat}}
-

関連情報

+

関連情報

    -
  • {{jsxref("Global_Objects/Intl", "Intl")}}
  • +
  • {{jsxref("Intl")}}
-- cgit v1.2.3-54-g00ecf