Files
url_tracker_tool/node_modules/date-fns/_lib/test.js
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

37 lines
1.0 KiB
JavaScript

"use strict";
exports.assertType = assertType;
exports.generateOffset = generateOffset;
exports.resetDefaultOptions = resetDefaultOptions;
var _index = require("./addLeadingZeros.js");
var _index2 = require("./defaultOptions.js");
function assertType(_) {}
function resetDefaultOptions() {
(0, _index2.setDefaultOptions)({});
}
// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
function generateOffset(originalDate) {
// Add the timezone.
let offset = "";
const tzOffset = originalDate.getTimezoneOffset();
if (tzOffset !== 0) {
const absoluteOffset = Math.abs(tzOffset);
const hourOffset = (0, _index.addLeadingZeros)(
Math.trunc(absoluteOffset / 60),
2,
);
const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2);
// If less than 0, the sign is +, because it is ahead of time.
const sign = tzOffset < 0 ? "+" : "-";
offset = `${sign}${hourOffset}:${minuteOffset}`;
} else {
offset = "Z";
}
return offset;
}