Skip to content

Commit

Permalink
Editor: render publish date control when the status is future(sched…
Browse files Browse the repository at this point in the history
…uled)
  • Loading branch information
ntsekouras committed May 28, 2024
1 parent fe40df6 commit 8106e7c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/editor/src/components/post-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
NAVIGATION_POST_TYPE,
} from '../../store/constants';
import PostPanelRow from '../post-panel-row';
import PostSchedule from '../post-schedule';
import { store as editorStore } from '../../store';

const labels = {
Expand Down Expand Up @@ -174,11 +175,6 @@ export default function PostStatus() {
let newPassword = password;
if ( status === 'future' && new Date( date ) > new Date() ) {
newDate = null;
} else if ( value === 'future' ) {
if ( ! date || new Date( date ) < new Date() ) {
newDate = new Date();
newDate.setDate( newDate.getDate() + 7 );
}
}
if ( value === 'private' && password ) {
newPassword = '';
Expand Down Expand Up @@ -232,6 +228,7 @@ export default function PostStatus() {
: status
}
/>
{ status === 'future' && <PostSchedule /> }
{ status !== 'private' && (
<VStack
as="fieldset"
Expand Down

0 comments on commit 8106e7c

Please sign in to comment.