lbdate
Version:
JavaScript Date object serialization helper.
15 lines • 597 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatTimeZone = void 0;
function formatTimeZone(mins) {
const isNegative = mins < 0;
if (isNegative)
mins = mins * -1;
const hours = mins / 60;
const hoursStr = (hours - hours % 1).toString();
const minsStr = (mins % 60).toString();
const padTime = (n) => n.length == 1 ? '0' + n : n;
return `${isNegative || mins == 0 ? '+' : '-'}${padTime(hoursStr)}:${padTime(minsStr)}`;
}
exports.formatTimeZone = formatTimeZone;
//# sourceMappingURL=format-time-zone.js.map