This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

24
node_modules/date-fns/esm/_lib/test/index.js generated vendored Normal file
View File

@@ -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;
}