diff options
| author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2021-06-21 13:37:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-21 13:37:57 +0900 |
| commit | 3de0442e6b266d967e9cdfde9590432b21b55e8c (patch) | |
| tree | 91b055170e8451c31770f8a57356c16a4fe16b11 /files/ja/web/javascript/reference/errors/deprecated_tolocaleformat | |
| parent | 0d495ad297d9e90ab35f54a822cd5e4e6a670713 (diff) | |
| download | translated-content-3de0442e6b266d967e9cdfde9590432b21b55e8c.tar.gz translated-content-3de0442e6b266d967e9cdfde9590432b21b55e8c.tar.bz2 translated-content-3de0442e6b266d967e9cdfde9590432b21b55e8c.zip | |
Web/JavaScript/Reference/Errors/D-G を更新 (#1162)
* Web/JavaScript/Reference/Errors/D-E を更新
2021/06/09 時点の最新版に同期
* Web/JavaScript/Reference/Errors/Getter_only を更新
* Web/JavaScript/Reference/Errors/Getter_only を更新
Diffstat (limited to 'files/ja/web/javascript/reference/errors/deprecated_tolocaleformat')
| -rw-r--r-- | files/ja/web/javascript/reference/errors/deprecated_tolocaleformat/index.html | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/files/ja/web/javascript/reference/errors/deprecated_tolocaleformat/index.html b/files/ja/web/javascript/reference/errors/deprecated_tolocaleformat/index.html index 685f3537d1..9939c21d2b 100644 --- a/files/ja/web/javascript/reference/errors/deprecated_tolocaleformat/index.html +++ b/files/ja/web/javascript/reference/errors/deprecated_tolocaleformat/index.html @@ -9,22 +9,25 @@ translation_of: Web/JavaScript/Reference/Errors/Deprecated_toLocaleFormat --- <div>{{jsSidebar("Errors")}}</div> -<h2 id="Message" name="Message">メッセージ</h2> +<p>JavaScript の警告 "Date.prototype.toLocaleFormat is deprecated; consider using + Intl.DateTimeFormat instead" は、標準外の {{jsxref("Date.prototype.toLocaleFormat")}} メソッドが使用されたときに発生します。</p> -<pre class="syntaxbox">Warning: Date.prototype.toLocaleFormat is deprecated; consider using Intl.DateTimeFormat instead +<h2 id="Message">エラーメッセージ</h2> + +<pre class="brush: js">Warning: Date.prototype.toLocaleFormat is deprecated; consider using Intl.DateTimeFormat instead </pre> -<h2 id="Error_type" name="Error_type">エラー種別</h2> +<h2 id="Error_type">エラーの種類</h2> -<p>警告。 JavaScript の実行は停止しません。</p> +<p>警告です。 JavaScript の実行は停止しません。</p> -<h2 id="What_went_wrong" name="What_went_wrong">エラーの原因</h2> +<h2 id="What_went_wrong">エラーの原因</h2> -<p>非標準の {{jsxref("Date.prototype.toLocaleFormat")}} メソッドは非推奨のため、使用すべきではありません。これは C 言語の <code>strftime()</code> 関数が期待するものと同じフォーマットの文字列を使用します。<strong>この関数は Firefox 58 以降ではもう利用できません。</strong></p> +<p>非標準の {{jsxref("Date.prototype.toLocaleFormat")}} メソッドは非推奨のため、使用すべきではありません。これは C 言語の <code>strftime()</code> 関数が期待するものと同じフォーマットの文字列を使用します。<strong>この関数は Firefox 58 以降では利用できなくなりました。</strong></p> -<h2 id="Examples" name="Examples">例</h2> +<h2 id="Examples">例</h2> -<h3 id="Deprecated_syntax" name="Deprecated_syntax">非推奨の構文</h3> +<h3 id="Deprecated_syntax">非推奨の構文</h3> <p>{{jsxref("Date.prototype.toLocaleFormat")}} メソッドは非推奨で、削除される予定です (クロスブラウザーの対応はなく、 Firefox でのみ使用できます)。</p> @@ -35,11 +38,11 @@ console.log(date); // In German locale // "Freitag, 10. März 2017"</pre> -<h3 id="ECMAScript_Intl_API_を使用した代わりの標準構文">ECMAScript Intl API を使用した代わりの標準構文</h3> +<h3 id="Alternative_standard_syntax_using_the_ECMAScript_Intl_API">ECMAScript Intl API を使用した代わりの標準構文</h3> -<p>ECMA-402 (ECMAScript Intl API) 標準では、言語に敏感な日付と時刻の書式設定を可能にする標準的なオブジェクトとメソッドを指定しています (Chrome 24+、Firefox 29+、IE11+、Safari10+ で使用できます)。</p> +<p>ECMA-402 (ECMAScript Intl API) 標準では、言語に敏感な日付と時刻の書式設定を可能にする標準的なオブジェクトとメソッドを指定しています (Chrome 24 以降、Firefox 29 以降、IE11 以降、Safari10 以降で使用できます)。</p> -<p>ある日付のフォーマットを指定する場合、{{jsxref("Date.prototype.toLocaleDateString")}} メソッドを使用すべきです。</p> +<p>ある日付のフォーマットを指定する場合、 {{jsxref("Date.prototype.toLocaleDateString")}} メソッドを使用すべきです。</p> <pre class="brush: js example-good">var today = new Date(); var options = { weekday: 'long', year: 'numeric', @@ -50,7 +53,7 @@ console.log(date); // "Freitag, 10. März 2017" </pre> -<p>または、{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}} オブジェクトを使用できます。これにより、ほとんど計算が完了したオブジェクトをキャッシュして、書式設定が高速になります。これは、日付のフォーマットを繰り返すときに役立ちます。</p> +<p>または、 {{jsxref("Intl/DateTimeFormat", "Intl.DateTimeFormat")}} オブジェクトを使用できます。これにより、ほとんど計算が完了したオブジェクトをキャッシュして、書式設定が高速になります。これは、日付の書式化を繰り返すときに役立ちます。</p> <pre class="brush: js example-good">var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; @@ -65,7 +68,7 @@ dates.forEach(date => console.log(dateFormatter.format(date))); // "Montag, 12. Mai 2014" </pre> -<h3 id="Alternative_standard_syntax_using_Date_methods" name="Alternative_standard_syntax_using_Date_methods">Date メソッドを使用した代わりの標準構文</h3> +<h3 id="Alternative_standard_syntax_using_Date_methods">Date メソッドを使用した代わりの標準構文</h3> <p>{{jsxref("Date")}} オブジェクトは、カスタム日付文字列を構築するいくつかのメソッドを提供しています。</p> @@ -82,10 +85,10 @@ let date = now.getFullYear() * 10000 + console.log(date); // "20170310"</pre> -<h2 id="See_also" name="See_also">関連情報</h2> +<h2 id="See_also">関連情報</h2> <ul> - <li>{{jsxref("Date.prototype.toLocaleFormat")}}</li> - <li>{{jsxref("Date.prototype.toLocaleDateString")}}</li> - <li>{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}}</li> + <li>{{jsxref("Date.prototype.toLocaleFormat")}}</li> + <li>{{jsxref("Date.prototype.toLocaleDateString")}}</li> + <li>{{jsxref("Intl/DateTimeFormat", "Intl.DateTimeFormat")}}</li> </ul> |
