From e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sat, 28 Jun 2025 17:26:46 -0700 Subject: initial commit: scaffolding --- node_modules/date-fns/esm/_lib/test/index.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 node_modules/date-fns/esm/_lib/test/index.js (limited to 'node_modules/date-fns/esm/_lib/test/index.js') diff --git a/node_modules/date-fns/esm/_lib/test/index.js b/node_modules/date-fns/esm/_lib/test/index.js new file mode 100644 index 0000000..6193684 --- /dev/null +++ b/node_modules/date-fns/esm/_lib/test/index.js @@ -0,0 +1,24 @@ +import addLeadingZeros from "../addLeadingZeros/index.js"; +import { setDefaultOptions } from "../defaultOptions/index.js"; +export function assertType(_) {} +export function resetDefaultOptions() { + setDefaultOptions({}); +} + +// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran. +export function generateOffset(originalDate) { + // Add the timezone. + var offset = ''; + var tzOffset = originalDate.getTimezoneOffset(); + if (tzOffset !== 0) { + var absoluteOffset = Math.abs(tzOffset); + var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2); + var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2); + // If less than 0, the sign is +, because it is ahead of time. + var sign = tzOffset < 0 ? '+' : '-'; + offset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset); + } else { + offset = 'Z'; + } + return offset; +} \ No newline at end of file -- cgit v1.2.3