MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / offset

Function offset

tests/test_code/js/moment/moment.js:3206–3221  ·  view source on GitHub ↗
(token, separator)

Source from the content-addressed store, hash-verified

3204 // FORMATTING
3205
3206 function offset(token, separator) {
3207 addFormatToken(token, 0, 0, function () {
3208 var offset = this.utcOffset(),
3209 sign = '+';
3210 if (offset < 0) {
3211 offset = -offset;
3212 sign = '-';
3213 }
3214 return (
3215 sign +
3216 zeroFill(~~(offset / 60), 2) +
3217 separator +
3218 zeroFill(~~offset % 60, 2)
3219 );
3220 });
3221 }
3222
3223 offset('Z', ':');
3224 offset('ZZ', '');

Callers 1

moment.jsFile · 0.85

Calls 2

addFormatTokenFunction · 0.85
zeroFillFunction · 0.85

Tested by

no test coverage detected