From f45e9e070c93ebbd83d488bdd775987a4d75c201 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:08 +0800 Subject: fix yari h2m dry run errors --- .../global_objects/date/getday/index.html | 4 +- .../reference/global_objects/date/index.html | 112 +++------------------ .../reference/global_objects/date/now/index.html | 75 +------------- .../reference/global_objects/date/utc/index.html | 81 +-------------- 4 files changed, 22 insertions(+), 250 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/global_objects/date') diff --git a/files/zh-tw/web/javascript/reference/global_objects/date/getday/index.html b/files/zh-tw/web/javascript/reference/global_objects/date/getday/index.html index dd5ebc36d4..80ab81fa2d 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/date/getday/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/date/getday/index.html @@ -29,8 +29,8 @@ var weekday = Xmas95.getDay(); console.log(weekday); // 1 -
-

Note: 如果需要,可以使用{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}}加上options參數來獲取星期幾全名。使使用此方法能輕鬆做出各種國際語言:

+
+

備註:如果需要,可以使用{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}}加上options參數來獲取星期幾全名。使使用此方法能輕鬆做出各種國際語言:

var options = { weekday: 'long'};
 console.log(new Intl.DateTimeFormat('en-US', options).format(Xmas95));
diff --git a/files/zh-tw/web/javascript/reference/global_objects/date/index.html b/files/zh-tw/web/javascript/reference/global_objects/date/index.html
index 1b1873dd22..9e7cab6fe9 100644
--- a/files/zh-tw/web/javascript/reference/global_objects/date/index.html
+++ b/files/zh-tw/web/javascript/reference/global_objects/date/index.html
@@ -18,18 +18,18 @@ new Date(dateString);
 new Date(year, month[, day[, hour[, minutes[, seconds[, milliseconds]]]]]);
 
-
-

附註: JavaScript Date 物件只能由以 Date 作為建構子來產生,如果把 Date 作為一般的函數來呼叫(省略掉 {{jsxref("Operators/new", "new")}} 運算子)將會得到一個字串而非 Date 物件;與其它 JavaScript 物件不同,它並沒有物件實體語法(例如:以中刮號 [ ] 表示陣列的宣告方式)。

+
+

備註:JavaScript Date 物件只能由以 Date 作為建構子來產生,如果把 Date 作為一般的函數來呼叫(省略掉 {{jsxref("Operators/new", "new")}} 運算子)將會得到一個字串而非 Date 物件;與其它 JavaScript 物件不同,它並沒有物件實體語法(例如:以中刮號 [ ] 表示陣列的宣告方式)。

參數

-
-

附註:當傳入超過一個參數到 Date 建構子,若參數值超過它的合理範圍(例如:傳數值 13 到月份,或傳數值 70 給分鐘),相鄰的參數值將會被調整。例如: new Date(2013, 13, 1) 將等同於 new Date(2014, 1, 1) 都會建立代表 2014-02-01 的物件(注意月份值由 0 開始)。同樣的, new Date(2013, 2, 1, 0, 70)new Date(2013, 2, 1, 1, 10) 一樣會建立代表 2013-03-01T01:10:00 的 Date 物件。

+
+

備註:當傳入超過一個參數到 Date 建構子,若參數值超過它的合理範圍(例如:傳數值 13 到月份,或傳數值 70 給分鐘),相鄰的參數值將會被調整。例如: new Date(2013, 13, 1) 將等同於 new Date(2014, 1, 1) 都會建立代表 2014-02-01 的物件(注意月份值由 0 開始)。同樣的, new Date(2013, 2, 1, 0, 70)new Date(2013, 2, 1, 1, 10) 一樣會建立代表 2013-03-01T01:10:00 的 Date 物件。

-
-

附註:當傳入超過一個參數到 Date 建構子,所指定的參數值會視為本地時間。如果希望指定的值為世界標準時間(UTC),則應使用 new Date({{jsxref("Date.UTC()", "Date.UTC(...)")}}) 語法,傳入一樣格式的參數。

+
+

備註:當傳入超過一個參數到 Date 建構子,所指定的參數值會視為本地時間。如果希望指定的值為世界標準時間(UTC),則應使用 new Date({{jsxref("Date.UTC()", "Date.UTC(...)")}}) 語法,傳入一樣格式的參數。

@@ -37,8 +37,8 @@ new Date(year, month[, day[, hour[,
自世界標準時間(UTC) 1970 年 1 月 1 日 00:00:00 開始的毫秒整數(Integer)值(Unix 紀元;但要注意到大多 Unix 時間戳記是以秒而非毫秒為單位)。
dateString
表示時間日期的字串。這個字串應該要能被 {{jsxref("Date.parse()")}} 方法解析(符合 IETF-compliant RFC 2822 timestampsversion of ISO8601 格式要求). -
-

附註: 由於各家瀏覽器有所不同且具有差異性,因此非常不鼓勵使用 Date 建構子(或 Date.parse 方法,它們是同等的)來解析時間日期字串。

+
+

備註:由於各家瀏覽器有所不同且具有差異性,因此非常不鼓勵使用 Date 建構子(或 Date.parse 方法,它們是同等的)來解析時間日期字串。

year
@@ -84,8 +84,8 @@ new Date(year, month[, day[, hour[,
回傳對應於當下時間的數值 - 1970/01/01 00:00:00 (UTC) 到當下的毫秒數。
{{jsxref("Date.parse()")}}
解析字串所表示的時間,回傳由 1970/01/01 00:00:00 (UTC) 到該時間的毫秒數值。 -
-

附註:由於瀏覽器之間的不同與差異,強烈不建議使用 Date.parse

+
+

備註:由於瀏覽器之間的不同與差異,強烈不建議使用 Date.parse

{{jsxref("Date.UTC()")}}
@@ -106,8 +106,8 @@ new Date(year, month[, day[, hour[,

接下來的幾個範例,展示幾種建立 Date 物件的方式:

-
-

附註: 由於瀏覽器之間的不同與差異,強烈不建議使用解析字串的方式建立 Date 物件。

+
+

備註:由於瀏覽器之間的不同與差異,強烈不建議使用解析字串的方式建立 Date 物件。

var today = new Date();
@@ -166,97 +166,17 @@ function printElapsedTime(fTest) {
 yourFunctionReturn = printElapsedTime(yourFunction);
 
-
-

附註:在瀏覽器支援 {{domxref("window.performance", "Web Performance API", "", 1)}} 高精度特性下, {{domxref("Performance.now()")}} 可以提供比 {{jsxref("Date.now()")}} 更可靠、精確的執行時間測試結果。

+
+

備註:在瀏覽器支援 {{domxref("window.performance", "Web Performance API", "", 1)}} 高精度特性下, {{domxref("Performance.now()")}} 可以提供比 {{jsxref("Date.now()")}} 更可靠、精確的執行時間測試結果。

規範

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
規範狀態
{{SpecName('ESDraft', '#sec-date-objects', 'Date')}}{{Spec2('ESDraft')}} 
{{SpecName('ES6', '#sec-date-objects', 'Date')}}{{Spec2('ES6')}} 
{{SpecName('ES5.1', '#sec-15.9', 'Date')}}{{Spec2('ES5.1')}} 
{{SpecName('ES1')}}{{Spec2('ES1')}}初步定義。實作在 JavaScript 1.1。
+{{Specifications}}

瀏覽器相容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
平台ChromeFirefox (Gecko)Internet ExplorerOperaSafari
-

基本支援

-
{{CompatVersionUnknown}} [1]{{CompatVersionUnknown}} [1]{{CompatVersionUnknown}} [2]{{CompatVersionUnknown}} [1]{{CompatVersionUnknown}} [1]
-
- -
- - - - - - - - - - - - - - - - - - - - - -
平台AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
-

基本支援

-
{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

[1] 一些瀏覽器在解析日期時間會發生問題: 3/14/2012 blog from danvk Comparing FF/IE/Chrome on Parsing Date Strings

diff --git a/files/zh-tw/web/javascript/reference/global_objects/date/now/index.html b/files/zh-tw/web/javascript/reference/global_objects/date/now/index.html index ca67a2e534..a6ea13ec86 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/date/now/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/date/now/index.html @@ -38,82 +38,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/now

規範

- - - - - - - - - - - - - - - - - - - - - - - -
規範狀態
{{SpecName('ES5.1', '#sec-15.9.4.4', 'Date.now')}}{{Spec2('ES5.1')}}初始定義,實作在 JavaScript 1.5 。
{{SpecName('ES6', '#sec-date.now', 'Date.now')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-date.now', 'Date.now')}}{{Spec2('ESDraft')}} 
+{{Specifications}}

瀏覽器相容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
平台ChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支援{{CompatChrome("5")}}{{CompatGeckoDesktop("1.9")}}{{CompatIE("9")}}{{CompatOpera("10.50")}}{{CompatSafari("4")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
平台AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支援{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相關資源

diff --git a/files/zh-tw/web/javascript/reference/global_objects/date/utc/index.html b/files/zh-tw/web/javascript/reference/global_objects/date/utc/index.html index 50ab7590ea..9d9a95d526 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/date/utc/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/date/utc/index.html @@ -67,88 +67,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/UTC

規範

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
規範狀態
{{SpecName('ESDraft', '#sec-date.utc', 'Date.UTC')}}{{Spec2('ESDraft')}} 
{{SpecName('ES6', '#sec-date.utc', 'Date.UTC')}}{{Spec2('ES6')}} 
{{SpecName('ES5.1', '#sec-15.9.4.3', 'Date.UTC')}}{{Spec2('ES5.1')}} 
{{SpecName('ES1')}}{{Spec2('ES1')}}初始定義。
- 實作在 JavaScript 1.0.
+{{Specifications}}

瀏覽器相容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
平台ChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支援{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
平台AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支援{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
+{{Compat}}

相關資源

-- cgit v1.2.3-54-g00ecf