File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
apps/web/core/components/cycles Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -136,14 +136,20 @@ export function CycleCreateUpdateModal(props: CycleModalProps) {
136136
137137 if ( payload . start_date && payload . end_date ) {
138138 if ( data ?. id ) {
139- // Update existing cycle - always include cycle_id for validation
140- isDateValid = await dateChecker ( projectId , {
141- start_date : payload . start_date ,
142- end_date : payload . end_date ,
143- cycle_id : data . id ,
144- } ) ;
139+ // Update existing cycle - only check dates if they've changed
140+ const originalStartDate = renderFormattedPayloadDate ( data . start_date ) ?? null ;
141+ const originalEndDate = renderFormattedPayloadDate ( data . end_date ) ?? null ;
142+ const hasDateChanged = payload . start_date !== originalStartDate || payload . end_date !== originalEndDate ;
143+
144+ if ( hasDateChanged ) {
145+ isDateValid = await dateChecker ( projectId , {
146+ start_date : payload . start_date ,
147+ end_date : payload . end_date ,
148+ cycle_id : data . id ,
149+ } ) ;
150+ }
145151 } else {
146- // Create new cycle - no cycle_id needed
152+ // Create new cycle - always check dates
147153 isDateValid = await dateChecker ( projectId , {
148154 start_date : payload . start_date ,
149155 end_date : payload . end_date ,
You can’t perform that action at this time.
0 commit comments