MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / parseTimezoneOffset

Function parseTimezoneOffset

src/utils/parseAuthor.js:17–21  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

15// but can also default to +0 was extraordinary.
16
17function parseTimezoneOffset(offset) {
18 let [, sign, hours, minutes] = offset.match(/(\+|-)(\d\d)(\d\d)/)
19 minutes = (sign === '+' ? 1 : -1) * (Number(hours) * 60 + Number(minutes))
20 return negateExceptForZero(minutes)
21}
22
23function negateExceptForZero(n) {
24 return n === 0 ? n : -n

Callers 1

parseAuthorFunction · 0.85

Calls 1

negateExceptForZeroFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…