axidio-styleguide-library1-v2 0.0.989 → 0.0.991
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.
|
@@ -8838,6 +8838,12 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8838
8838
|
if (isValueToBeIgnored) {
|
|
8839
8839
|
return '';
|
|
8840
8840
|
}
|
|
8841
|
+
// Always add space before and after hyphen for date range labels
|
|
8842
|
+
const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
|
|
8843
|
+
if (dateRangeRegex.test(d.trim())) {
|
|
8844
|
+
// Replace any hyphen between two dates with ' - '
|
|
8845
|
+
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
8846
|
+
}
|
|
8841
8847
|
// If label looks like a date (contains digits and - or /)
|
|
8842
8848
|
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8843
8849
|
// Only split date/week labels if there are many grouped bars and header is not visible
|