Skip to content

Commit

Permalink
Fix syncing of publish date between publish and post status panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed May 31, 2024
1 parent 61afbd5 commit 4ce0884
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ export function PublishDateTimePicker(
onChange,
showPopoverHeaderActions,
isCompact,
currentDate,
...additionalProps
},
ref
) {
const datePickerProps = {
startOfWeek: getSettings().l10n.startOfWeek,
onChange,
currentDate: isCompact ? undefined : currentDate,
currentTime: isCompact ? currentDate : undefined,
...additionalProps,
};
const DatePickerComponent = isCompact ? TimePicker : DateTimePicker;
return (
<div ref={ ref } className="block-editor-publish-date-time-picker">
Expand All @@ -38,11 +46,7 @@ export function PublishDateTimePicker(
}
onClose={ onClose }
/>
<DatePickerComponent
startOfWeek={ getSettings().l10n.startOfWeek }
onChange={ onChange }
{ ...additionalProps }
/>
<DatePickerComponent { ...datePickerProps } />
</div>
);
}
Expand Down

0 comments on commit 4ce0884

Please sign in to comment.