File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/curated-corpus/components/CustomSectionForm Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,9 @@ export const getValidationSchema = (isEditMode: boolean = false) => {
4545 'not-in-past' ,
4646 'Start date cannot be in the past' ,
4747 function ( value ) {
48- // TODO(HNT-1125): Remove the edit-mode bypass and enforce start-date validation
49- // for manually typed values once editorial confirms we should always require
50- // startDate >= today for new and existing sections.
51- if ( ! value || isEditMode ) {
48+ // Always enforce start date validation, even in edit mode
49+ // This ensures scheduled or live sections always start on or after today
50+ if ( ! value ) {
5251 return true ;
5352 }
5453 const startDate = DateTime . fromJSDate ( value ) . startOf ( 'day' ) ;
@@ -60,7 +59,8 @@ export const getValidationSchema = (isEditMode: boolean = false) => {
6059 . date ( )
6160 . nullable ( )
6261 . test ( 'not-in-past' , 'End date cannot be in the past' , function ( value ) {
63- if ( ! value || isEditMode ) {
62+ // Always enforce end date validation, even in edit mode
63+ if ( ! value ) {
6464 return true ;
6565 }
6666 const endDate = DateTime . fromJSDate ( value ) . startOf ( 'day' ) ;
You can’t perform that action at this time.
0 commit comments