From b8bc24d167f2e19482d9dc6d367876c361abf4ea Mon Sep 17 00:00:00 2001 From: Anh Hong Date: Fri, 11 Dec 2020 02:45:45 +0700 Subject: chore: fixed various misspellings and other typos (#8691) --- std/datetime/mod.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'std/datetime/mod.ts') diff --git a/std/datetime/mod.ts b/std/datetime/mod.ts index 2afddbe6f..72f8cc681 100644 --- a/std/datetime/mod.ts +++ b/std/datetime/mod.ts @@ -84,13 +84,13 @@ export function weekOfYear(date: Date): number { } /** - * Parse a date to return a IMF formated string date + * Parse a date to return a IMF formatted string date * RFC: https://tools.ietf.org/html/rfc7231#section-7.1.1.1 * IMF is the time format to use when generating times in HTTP * headers. The time being formatted must be in UTC for Format to * generate the correct format. * @param date Date to parse - * @return IMF date formated string + * @return IMF date formatted string */ export function toIMF(date: Date): string { function dtPad(v: string, lPad = 2): string { @@ -233,16 +233,16 @@ function calculateMonthsDifference(bigger: number, smaller: number): number { const smallerDate = new Date(smaller); const yearsDiff = biggerDate.getFullYear() - smallerDate.getFullYear(); const monthsDiff = biggerDate.getMonth() - smallerDate.getMonth(); - const calendarDiffrences = Math.abs(yearsDiff * 12 + monthsDiff); + const calendarDifferences = Math.abs(yearsDiff * 12 + monthsDiff); const compareResult = biggerDate > smallerDate ? 1 : -1; biggerDate.setMonth( - biggerDate.getMonth() - compareResult * calendarDiffrences, + biggerDate.getMonth() - compareResult * calendarDifferences, ); const isLastMonthNotFull = biggerDate > smallerDate ? 1 : -1 === -compareResult ? 1 : 0; - const months = compareResult * (calendarDiffrences - isLastMonthNotFull); + const months = compareResult * (calendarDifferences - isLastMonthNotFull); return months === 0 ? 0 : months; } -- cgit v1.2.3