MCPcopy
hub / github.com/iamkun/dayjs / padZoneStr

Function padZoneStr

src/utils.js:9–15  ·  view source on GitHub ↗
(instance)

Source from the content-addressed store, hash-verified

7}
8
9const padZoneStr = (instance) => {
10 const negMinutes = -instance.utcOffset()
11 const minutes = Math.abs(negMinutes)
12 const hourOffset = Math.floor(minutes / 60)
13 const minuteOffset = minutes % 60
14 return `${negMinutes <= 0 ? '+' : '-'}${padStart(hourOffset, 2, '0')}:${padStart(minuteOffset, 2, '0')}`
15}
16
17const monthDiff = (a, b) => {
18 // function from moment.js in order to keep the same result

Callers 1

utils.test.jsFile · 0.85

Calls 2

padStartFunction · 0.85
utcOffsetMethod · 0.65

Tested by

no test coverage detected