1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00

fix typo miliseconds -> milliseconds (#7469)

This commit is contained in:
tasshi / Masaharu TASHIRO 2020-09-15 11:48:49 +09:00 committed by GitHub
parent 5819cfbeec
commit 85b98f6dd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -133,7 +133,7 @@ export function isLeap(year: Date | number): boolean {
}
export type Unit =
| "miliseconds"
| "milliseconds"
| "seconds"
| "minutes"
| "hours"
@ -167,7 +167,7 @@ export function difference(
options?: DifferenceOptions,
): DifferenceFormat {
const uniqueUnits = options?.units ? [...new Set(options?.units)] : [
"miliseconds",
"milliseconds",
"seconds",
"minutes",
"hours",
@ -186,8 +186,8 @@ export function difference(
for (const uniqueUnit of uniqueUnits) {
switch (uniqueUnit) {
case "miliseconds":
differences.miliseconds = differenceInMs;
case "milliseconds":
differences.milliseconds = differenceInMs;
break;
case "seconds":
differences.seconds = Math.floor(differenceInMs / SECOND);

View file

@ -284,9 +284,9 @@ Deno.test({
const birth = new Date("1998/2/23 10:10:10");
const old = new Date("1998/2/23 11:11:11");
difference = datetime.difference(birth, old, {
units: ["miliseconds", "minutes", "seconds", "hours"],
units: ["milliseconds", "minutes", "seconds", "hours"],
});
assertEquals(difference.miliseconds, 3661000);
assertEquals(difference.milliseconds, 3661000);
assertEquals(difference.seconds, 3661);
assertEquals(difference.minutes, 61);
assertEquals(difference.hours, 1);

View file

@ -70,7 +70,7 @@ function constructYamlTimestamp(data: string): Date {
if (match[9]) {
const tzHour = +match[10];
const tzMinute = +(match[11] || 0);
delta = (tzHour * 60 + tzMinute) * 60000; // delta in mili-seconds
delta = (tzHour * 60 + tzMinute) * 60000; // delta in milli-seconds
if (match[9] === "-") delta = -delta;
}