From 90c98e44a74512d092585c9fa49c7f6710aa8b29 Mon Sep 17 00:00:00 2001 From: dyoshikawa <34151621+dyoshikawa@users.noreply.github.com> Date: Mon, 3 Aug 2020 02:18:48 +0900 Subject: [PATCH] chore: Fix typo (#977) --- src/plugin/timezone/index.js | 10 +++++----- src/utils.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugin/timezone/index.js b/src/plugin/timezone/index.js index 842f2efa5..7cf7c34be 100644 --- a/src/plugin/timezone/index.js +++ b/src/plugin/timezone/index.js @@ -21,10 +21,10 @@ export default (o, c, d) => { minute: '2-digit', second: '2-digit' }) - const fotmatResult = dtf.formatToParts(date) + const formatResult = dtf.formatToParts(date) const filled = [] - for (let i = 0; i < fotmatResult.length; i += 1) { - const { type, value } = fotmatResult[i] + for (let i = 0; i < formatResult.length; i += 1) { + const { type, value } = formatResult[i] const pos = typeToPos[type] if (pos >= 0) { @@ -58,9 +58,9 @@ export default (o, c, d) => { return d(target).utcOffset(localUtcOffset - diff, true) } d.tz = function (input, timezone) { - const previousoffset = tzOffset(+d(), timezone) + const previousOffset = tzOffset(+d(), timezone) const localTs = d.utc(input).valueOf() - const [targetTs, targetOffset] = fixOffset(localTs, previousoffset, timezone) + const [targetTs, targetOffset] = fixOffset(localTs, previousOffset, timezone) const ins = d(targetTs).utcOffset(targetOffset) return ins } diff --git a/src/utils.js b/src/utils.js index 6ef4ce629..ae81679f8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -7,11 +7,11 @@ const padStart = (string, length, pad) => { } const padZoneStr = (instance) => { - const negMinuts = -instance.utcOffset() - const minutes = Math.abs(negMinuts) + const negMinutes = -instance.utcOffset() + const minutes = Math.abs(negMinutes) const hourOffset = Math.floor(minutes / 60) const minuteOffset = minutes % 60 - return `${negMinuts <= 0 ? '+' : '-'}${padStart(hourOffset, 2, '0')}:${padStart(minuteOffset, 2, '0')}` + return `${negMinutes <= 0 ? '+' : '-'}${padStart(hourOffset, 2, '0')}:${padStart(minuteOffset, 2, '0')}` } const monthDiff = (a, b) => {