@rufous/ui 0.3.1 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs CHANGED
@@ -3016,6 +3016,11 @@ var parseDisplay = (str, fmt = "MM/DD/YYYY") => {
3016
3016
  };
3017
3017
  var isoToDate = (iso) => {
3018
3018
  if (!iso) return null;
3019
+ if (iso.endsWith("Z") || /[+-]\d{2}:?\d{2}$/.test(iso)) {
3020
+ const d2 = new Date(iso);
3021
+ if (isNaN(d2.getTime())) return null;
3022
+ return new Date(d2.getFullYear(), d2.getMonth(), d2.getDate());
3023
+ }
3019
3024
  const [datePart] = iso.split("T");
3020
3025
  const [y, mo, d] = datePart.split("-").map(Number);
3021
3026
  if (!y || !mo || !d) return null;
@@ -3028,7 +3033,7 @@ var today = () => {
3028
3033
  var isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
3029
3034
  var normaliseBoundary = (d) => {
3030
3035
  if (!d) return null;
3031
- const base = d instanceof Date ? d : isoToDate(typeof d === "string" ? d.split("T")[0] : d);
3036
+ const base = d instanceof Date ? d : isoToDate(d);
3032
3037
  if (!base) return null;
3033
3038
  return new Date(base.getFullYear(), base.getMonth(), base.getDate());
3034
3039
  };
package/dist/main.js CHANGED
@@ -2867,6 +2867,11 @@ var parseDisplay = (str, fmt = "MM/DD/YYYY") => {
2867
2867
  };
2868
2868
  var isoToDate = (iso) => {
2869
2869
  if (!iso) return null;
2870
+ if (iso.endsWith("Z") || /[+-]\d{2}:?\d{2}$/.test(iso)) {
2871
+ const d2 = new Date(iso);
2872
+ if (isNaN(d2.getTime())) return null;
2873
+ return new Date(d2.getFullYear(), d2.getMonth(), d2.getDate());
2874
+ }
2870
2875
  const [datePart] = iso.split("T");
2871
2876
  const [y, mo, d] = datePart.split("-").map(Number);
2872
2877
  if (!y || !mo || !d) return null;
@@ -2879,7 +2884,7 @@ var today = () => {
2879
2884
  var isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
2880
2885
  var normaliseBoundary = (d) => {
2881
2886
  if (!d) return null;
2882
- const base = d instanceof Date ? d : isoToDate(typeof d === "string" ? d.split("T")[0] : d);
2887
+ const base = d instanceof Date ? d : isoToDate(d);
2883
2888
  if (!base) return null;
2884
2889
  return new Date(base.getFullYear(), base.getMonth(), base.getDate());
2885
2890
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rufous/ui",
3
3
  "private": false,
4
- "version": "0.3.01",
4
+ "version": "0.3.11",
5
5
  "type": "module",
6
6
  "description": "Experimental: A lightweight React UI component library (Beta)",
7
7
  "style": "./dist/main.css",