axidio-styleguide-library1-v2 0.2.89 → 0.2.90
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.
|
@@ -7953,6 +7953,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7953
7953
|
// Check if we're on mobile or tablet
|
|
7954
7954
|
const isSmallScreen = window.innerWidth < 992; // Less than 992px (mobile or tablet)
|
|
7955
7955
|
// Check if label contains both date and week information
|
|
7956
|
+
const formatDatePart = (dateStr) => {
|
|
7957
|
+
// Match different date formats: MM/DD/YYYY, YYYY/MM/DD, etc.
|
|
7958
|
+
const match = dateStr.match(/(\d{1,4})[-\/](\d{1,2})[-\/](\d{1,4})/);
|
|
7959
|
+
if (!match)
|
|
7960
|
+
return dateStr;
|
|
7961
|
+
const [_, part1, part2, part3] = match;
|
|
7962
|
+
// Check if year is first (YYYY/MM/DD)
|
|
7963
|
+
if (part1.length === 4) {
|
|
7964
|
+
return `${part2}/${part3}`; // Return MM/DD
|
|
7965
|
+
}
|
|
7966
|
+
// For MM/DD/YYYY format
|
|
7967
|
+
return `${part1}/${part2}`; // Return MM/DD
|
|
7968
|
+
};
|
|
7956
7969
|
const hasDateAndTime = (text) => {
|
|
7957
7970
|
const dateMatch = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(text) || !isNaN(Date.parse(text));
|
|
7958
7971
|
const weekMatch = /week|wk|w\d+/i.test(text);
|
|
@@ -7962,7 +7975,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7962
7975
|
// Apply date-week trimming only for mobile and tablet screens
|
|
7963
7976
|
if (isSmallScreen && labelInfo.isDate && labelInfo.isWeek) {
|
|
7964
7977
|
const datePart = d.match(/\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/);
|
|
7965
|
-
|
|
7978
|
+
if (datePart) {
|
|
7979
|
+
return formatDatePart(datePart[0]);
|
|
7980
|
+
}
|
|
7981
|
+
return d;
|
|
7966
7982
|
}
|
|
7967
7983
|
// Mobile handling: keep date labels intact for single-series charts (do not trim)
|
|
7968
7984
|
if (isMobile) {
|