Skip to content

Instantly share code, notes, and snippets.

@luixo
Created March 28, 2025 11:42
Show Gist options
  • Select an option

  • Save luixo/d1954b001280b81b1250ea55b0e149ee to your computer and use it in GitHub Desktop.

Select an option

Save luixo/d1954b001280b81b1250ea55b0e149ee to your computer and use it in GitHub Desktop.
# Circular dependency in the package breaks Vercel deploy
# Remove when fixed is merged: https://github.com/adobe/react-spectrum/pull/8001
diff --git a/dist/utils.main.js b/dist/utils.main.js
index 063aa6f2c6540544db0ed81abd88191bfb6004ac..f099325155affcefcd38f698835f0d6ba5045529 100644
--- a/dist/utils.main.js
+++ b/dist/utils.main.js
@@ -1,5 +1,3 @@
-var $625ad1e1f4c43bc1$exports = require("./CalendarDate.main.js");
-
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
@@ -16,18 +14,9 @@ $parcel$export(module.exports, "mod", () => $a5090d6430502238$export$842a2cf37af
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
- */
-function $a5090d6430502238$export$842a2cf37af977e1(amount, numerator) {
+ */ function $a5090d6430502238$export$842a2cf37af977e1(amount, numerator) {
return amount - numerator * Math.floor(amount / numerator);
}
-function $a5090d6430502238$export$784d13d8ee351f07(date) {
- if (date.era) return new (0, $625ad1e1f4c43bc1$exports.CalendarDate)(date.calendar, date.era, date.year, date.month, date.day);
- else return new (0, $625ad1e1f4c43bc1$exports.CalendarDate)(date.calendar, date.year, date.month, date.day);
-}
-function $a5090d6430502238$export$27fa0172ae2644b3(date) {
- if (date.era) return new (0, $625ad1e1f4c43bc1$exports.CalendarDateTime)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
- else return new (0, $625ad1e1f4c43bc1$exports.CalendarDateTime)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
-}
//# sourceMappingURL=utils.main.js.map
diff --git a/dist/utils.main.js.map b/dist/utils.main.js.map
index b3fb16a4847ea41d2d366510eccd1ef4b3a7ec3f..911e7f2ba48281a92b02736b76152ffdc3de3f1c 100644
--- a/dist/utils.main.js.map
+++ b/dist/utils.main.js.map
@@ -1 +1 @@
-{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAQM,SAAS,0CAAI,MAAc,EAAE,SAAiB;IACnD,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,SAAS;AAClD;AAEO,SAAS,0CAAK,IAAkB;IACrC,IAAI,KAAK,GAAG,EACV,OAAO,IAAI,CAAA,GAAA,sCAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG;SAEhF,OAAO,IAAI,CAAA,GAAA,sCAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG;AAE1E;AAEO,SAAS,0CAAa,IAAsB;IACjD,IAAI,KAAK,GAAG,EACV,OAAO,IAAI,CAAA,GAAA,0CAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW;SAE3I,OAAO,IAAI,CAAA,GAAA,0CAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM;AAEnH","sources":["packages/@internationalized/date/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime} from './CalendarDate';\n\nexport type Mutable<T> = {\n -readonly[P in keyof T]: T[P]\n};\n\nexport function mod(amount: number, numerator: number): number {\n return amount - numerator * Math.floor(amount / numerator);\n}\n\nexport function copy(date: CalendarDate): Mutable<CalendarDate> {\n if (date.era) {\n return new CalendarDate(date.calendar, date.era, date.year, date.month, date.day);\n } else {\n return new CalendarDate(date.calendar, date.year, date.month, date.day);\n }\n}\n\nexport function copyDateTime(date: CalendarDateTime): Mutable<CalendarDateTime> {\n if (date.era) {\n return new CalendarDateTime(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n } else {\n return new CalendarDateTime(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);\n }\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
\ No newline at end of file
+{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAMM,SAAS,0CAAI,MAAc,EAAE,SAAiB;IACnD,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,SAAS;AAClD","sources":["packages/@internationalized/date/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type Mutable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\nexport function mod(amount: number, numerator: number): number {\n return amount - numerator * Math.floor(amount / numerator);\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
\ No newline at end of file
diff --git a/dist/utils.mjs b/dist/utils.mjs
index 3382d371d1df051ca158f8e092ff6adb3c5814e6..ee2adfc8249da7ec9ec08d4c13e477760217c8b5 100644
--- a/dist/utils.mjs
+++ b/dist/utils.mjs
@@ -1,5 +1,3 @@
-import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f} from "./CalendarDate.mjs";
-
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -10,19 +8,10 @@ import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateT
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
- */
-function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
+ */ function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
return amount - numerator * Math.floor(amount / numerator);
}
-function $2b4dce13dd5a17fa$export$784d13d8ee351f07(date) {
- if (date.era) return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.era, date.year, date.month, date.day);
- else return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.year, date.month, date.day);
-}
-function $2b4dce13dd5a17fa$export$27fa0172ae2644b3(date) {
- if (date.era) return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
- else return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
-}
-export {$2b4dce13dd5a17fa$export$842a2cf37af977e1 as mod, $2b4dce13dd5a17fa$export$784d13d8ee351f07 as copy, $2b4dce13dd5a17fa$export$27fa0172ae2644b3 as copyDateTime};
+export {$2b4dce13dd5a17fa$export$842a2cf37af977e1 as mod};
//# sourceMappingURL=utils.module.js.map
diff --git a/dist/utils.module.js b/dist/utils.module.js
index a93ad9cc9ac854373e58b57b63d6da3ac36935e6..ee2adfc8249da7ec9ec08d4c13e477760217c8b5 100644
--- a/dist/utils.module.js
+++ b/dist/utils.module.js
@@ -1,5 +1,3 @@
-import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f} from "./CalendarDate.module.js";
-
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -10,19 +8,10 @@ import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateT
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
- */
-function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
+ */ function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
return amount - numerator * Math.floor(amount / numerator);
}
-function $2b4dce13dd5a17fa$export$784d13d8ee351f07(date) {
- if (date.era) return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.era, date.year, date.month, date.day);
- else return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.year, date.month, date.day);
-}
-function $2b4dce13dd5a17fa$export$27fa0172ae2644b3(date) {
- if (date.era) return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
- else return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
-}
-export {$2b4dce13dd5a17fa$export$842a2cf37af977e1 as mod, $2b4dce13dd5a17fa$export$784d13d8ee351f07 as copy, $2b4dce13dd5a17fa$export$27fa0172ae2644b3 as copyDateTime};
+export {$2b4dce13dd5a17fa$export$842a2cf37af977e1 as mod};
//# sourceMappingURL=utils.module.js.map
diff --git a/dist/utils.module.js.map b/dist/utils.module.js.map
index 744f6bdc05c973f38d05849515c4f409483df57d..367f3812bd194b48557549f2c8b9e4ab0545014f 100644
--- a/dist/utils.module.js.map
+++ b/dist/utils.module.js.map
@@ -1 +1 @@
-{"mappings":";;AAAA;;;;;;;;;;CAUC;AAQM,SAAS,0CAAI,MAAc,EAAE,SAAiB;IACnD,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,SAAS;AAClD;AAEO,SAAS,0CAAK,IAAkB;IACrC,IAAI,KAAK,GAAG,EACV,OAAO,IAAI,CAAA,GAAA,yCAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG;SAEhF,OAAO,IAAI,CAAA,GAAA,yCAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG;AAE1E;AAEO,SAAS,0CAAa,IAAsB;IACjD,IAAI,KAAK,GAAG,EACV,OAAO,IAAI,CAAA,GAAA,yCAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW;SAE3I,OAAO,IAAI,CAAA,GAAA,yCAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM;AAEnH","sources":["packages/@internationalized/date/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime} from './CalendarDate';\n\nexport type Mutable<T> = {\n -readonly[P in keyof T]: T[P]\n};\n\nexport function mod(amount: number, numerator: number): number {\n return amount - numerator * Math.floor(amount / numerator);\n}\n\nexport function copy(date: CalendarDate): Mutable<CalendarDate> {\n if (date.era) {\n return new CalendarDate(date.calendar, date.era, date.year, date.month, date.day);\n } else {\n return new CalendarDate(date.calendar, date.year, date.month, date.day);\n }\n}\n\nexport function copyDateTime(date: CalendarDateTime): Mutable<CalendarDateTime> {\n if (date.era) {\n return new CalendarDateTime(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n } else {\n return new CalendarDateTime(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);\n }\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
\ No newline at end of file
+{"mappings":"AAAA;;;;;;;;;;CAUC,GAMM,SAAS,0CAAI,MAAc,EAAE,SAAiB;IACnD,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,SAAS;AAClD","sources":["packages/@internationalized/date/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type Mutable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\nexport function mod(amount: number, numerator: number): number {\n return amount - numerator * Math.floor(amount / numerator);\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
\ No newline at end of file
diff --git a/src/utils.ts b/src/utils.ts
index a4fb752f0cd569b704396b3ace10290b7a679bf0..94f74cbb4e5efdde1294efe0361d51b6267689a4 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -10,8 +10,6 @@
* governing permissions and limitations under the License.
*/
-import {CalendarDate, CalendarDateTime} from './CalendarDate';
-
export type Mutable<T> = {
-readonly[P in keyof T]: T[P]
};
@@ -19,19 +17,3 @@ export type Mutable<T> = {
export function mod(amount: number, numerator: number): number {
return amount - numerator * Math.floor(amount / numerator);
}
-
-export function copy(date: CalendarDate): Mutable<CalendarDate> {
- if (date.era) {
- return new CalendarDate(date.calendar, date.era, date.year, date.month, date.day);
- } else {
- return new CalendarDate(date.calendar, date.year, date.month, date.day);
- }
-}
-
-export function copyDateTime(date: CalendarDateTime): Mutable<CalendarDateTime> {
- if (date.era) {
- return new CalendarDateTime(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
- } else {
- return new CalendarDateTime(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
- }
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment