We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e6f93b commit 9718772Copy full SHA for 9718772
packages/decap-cms-widget-datetime/src/DateTimeControl.js
@@ -114,9 +114,14 @@ class DateTimeControl extends React.Component {
114
formatInputValue(value) {
115
if (value === '') return value;
116
const { format, inputFormat } = this.getFormat();
117
- return this.isUtc
+ const inputValue = this.isUtc
118
? dayjs.utc(value, format).format(inputFormat)
119
: dayjs(value, format).format(inputFormat);
120
+
121
+ if (this.isValidDate(inputValue)) {
122
+ return inputValue;
123
+ }
124
+ return this.isUtc ? dayjs.utc(value).format(inputFormat) : dayjs(value).format(inputFormat);
125
}
126
127
handleChange = datetime => {
0 commit comments