axidio-styleguide-library1-v2 0.0.990 → 0.0.992
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,14 +8838,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8838
8838
|
if (isValueToBeIgnored) {
|
|
8839
8839
|
return '';
|
|
8840
8840
|
}
|
|
8841
|
-
//
|
|
8842
|
-
const dateRangeRegex =
|
|
8841
|
+
// Always add space before and after hyphen for date range labels, even when header is visible and label is single line
|
|
8842
|
+
const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
|
|
8843
8843
|
if (dateRangeRegex.test(d.trim())) {
|
|
8844
|
-
|
|
8845
|
-
const match = d.trim().match(dateRangeRegex);
|
|
8846
|
-
if (match) {
|
|
8847
|
-
return `${match[1]} - ${match[2]}`;
|
|
8848
|
-
}
|
|
8844
|
+
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
8849
8845
|
}
|
|
8850
8846
|
// If label looks like a date (contains digits and - or /)
|
|
8851
8847
|
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|