Skip to content

Commit

Permalink
Fix time change
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Jan 22, 2025
1 parent 4b4a76a commit af7a29a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/apps/authoring-react/fields/datetime/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from 'superdesk-api';
import {gettext} from 'core/utils';
import {appConfig} from 'appConfig';
import {cloneDeep} from 'lodash';

type IProps = IEditorComponentProps<IDateTimeValueOperational, IDateTimeFieldConfig, IDateTimeUserPreferences>;

Expand All @@ -23,7 +24,10 @@ export class Editor extends React.PureComponent<IProps> {
text: gettext('Date time'),
hidden: true,
}}
onChange={this.props.onChange}
onChange={(val) => {
// if value passed to onChange has the same reference, storageAdapter won't be triggered
this.props.onChange(cloneDeep(val));
}}
value={this.props.value}
disabled={this.props.config.readOnly}
width={this.props.config.width}
Expand Down

0 comments on commit af7a29a

Please sign in to comment.