carbon-react 106.3.0 → 106.3.1
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.
|
@@ -76,7 +76,7 @@ function findMatchWithNoSeparators(valueString, formatString) {
|
|
|
76
76
|
const valueArray = makeSeparatedValues(indexArray, valueString);
|
|
77
77
|
|
|
78
78
|
if (checkForCompleteMatch(formatArray, valueArray)) {
|
|
79
|
-
return [formatArray.join("
|
|
79
|
+
return [formatArray.join(" "), valueArray.join(" ")];
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return null;
|
|
@@ -119,8 +119,10 @@ const DateInput = ({
|
|
|
119
119
|
|
|
120
120
|
if (isDateValid(selectedDays)) {
|
|
121
121
|
event = buildCustomEvent(ev);
|
|
122
|
+
const currentValue = checkISOFormatAndLength(value) ? formattedValue(format, parseISODate(value)) : value;
|
|
123
|
+
const [, matchedValue] = findMatchedFormatAndValue(currentValue, formats);
|
|
122
124
|
|
|
123
|
-
if (formattedValue(format, selectedDays) !==
|
|
125
|
+
if (formattedValue(format, selectedDays) !== matchedValue) {
|
|
124
126
|
onChange(event);
|
|
125
127
|
}
|
|
126
128
|
} else {
|
|
@@ -97,7 +97,7 @@ function findMatchWithNoSeparators(valueString, formatString) {
|
|
|
97
97
|
const valueArray = makeSeparatedValues(indexArray, valueString);
|
|
98
98
|
|
|
99
99
|
if (checkForCompleteMatch(formatArray, valueArray)) {
|
|
100
|
-
return [formatArray.join("
|
|
100
|
+
return [formatArray.join(" "), valueArray.join(" ")];
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
return null;
|
|
@@ -144,8 +144,10 @@ const DateInput = ({
|
|
|
144
144
|
|
|
145
145
|
if ((0, _utils.isDateValid)(selectedDays)) {
|
|
146
146
|
event = buildCustomEvent(ev);
|
|
147
|
+
const currentValue = (0, _utils.checkISOFormatAndLength)(value) ? (0, _utils.formattedValue)(format, (0, _utils.parseISODate)(value)) : value;
|
|
148
|
+
const [, matchedValue] = (0, _utils.findMatchedFormatAndValue)(currentValue, formats);
|
|
147
149
|
|
|
148
|
-
if ((0, _utils.formattedValue)(format, selectedDays) !==
|
|
150
|
+
if ((0, _utils.formattedValue)(format, selectedDays) !== matchedValue) {
|
|
149
151
|
onChange(event);
|
|
150
152
|
}
|
|
151
153
|
} else {
|