提交 26bf928d 编写于 作者: L Leo Chandra 提交者: Ry Dahl

fix: std/datetime toIMF bug (#3357)

上级 34ed16ed
...@@ -126,11 +126,12 @@ export function toIMF(date: Date): string { ...@@ -126,11 +126,12 @@ export function toIMF(date: Date): string {
const min = dtPad(date.getUTCMinutes().toString()); const min = dtPad(date.getUTCMinutes().toString());
const s = dtPad(date.getUTCSeconds().toString()); const s = dtPad(date.getUTCSeconds().toString());
const y = date.getUTCFullYear(); const y = date.getUTCFullYear();
const days = ["Sun", "Mon", "Tue", "Wed", "Thus", "Fri", "Sat"]; const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const months = [ const months = [
"Jan", "Jan",
"Feb", "Feb",
"Mar", "Mar",
"Apr",
"May", "May",
"Jun", "Jun",
"Jul", "Jul",
......
...@@ -81,7 +81,7 @@ test({ ...@@ -81,7 +81,7 @@ test({
name: "[DateTime] to IMF", name: "[DateTime] to IMF",
fn(): void { fn(): void {
const actual = datetime.toIMF(new Date(Date.UTC(1994, 3, 5, 15, 32))); const actual = datetime.toIMF(new Date(Date.UTC(1994, 3, 5, 15, 32)));
const expected = "Tue, 05 May 1994 15:32:00 GMT"; const expected = "Tue, 05 Apr 1994 15:32:00 GMT";
assertEquals(actual, expected); assertEquals(actual, expected);
} }
}); });
...@@ -90,7 +90,7 @@ test({ ...@@ -90,7 +90,7 @@ test({
name: "[DateTime] to IMF 0", name: "[DateTime] to IMF 0",
fn(): void { fn(): void {
const actual = datetime.toIMF(new Date(0)); const actual = datetime.toIMF(new Date(0));
const expected = "Thus, 01 Jan 1970 00:00:00 GMT"; const expected = "Thu, 01 Jan 1970 00:00:00 GMT";
assertEquals(actual, expected); assertEquals(actual, expected);
} }
}); });
...@@ -39,7 +39,7 @@ test({ ...@@ -39,7 +39,7 @@ test({
delCookie(res, "deno"); delCookie(res, "deno");
assertEquals( assertEquals(
res.headers!.get("Set-Cookie"), res.headers!.get("Set-Cookie"),
"deno=; Expires=Thus, 01 Jan 1970 00:00:00 GMT" "deno=; Expires=Thu, 01 Jan 1970 00:00:00 GMT"
); );
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册