Skip to content

Commit 2915016

Browse files
authored
Merge branch 'main' into HNT-1126-reuse-remove-section-item-modal
2 parents f6546a8 + d926cc2 commit 2915016

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/curated-corpus/components/CustomSectionForm/CustomSectionForm.validation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)