Skip to content

Commit

Permalink
chore: Fix typo (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyoshikawa authored Aug 2, 2020
1 parent 19e8a7f commit 90c98e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/plugin/timezone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 90c98e4

Please sign in to comment.