feat(calendar): monthly repeat sub-type options — calendar-repeat.service + tests#7930
Closed
renemadsen wants to merge 4 commits into
Closed
feat(calendar): monthly repeat sub-type options — calendar-repeat.service + tests#7930renemadsen wants to merge 4 commits into
renemadsen wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…repeat service - buildMetaFromCustomConfig: add monthlyKind/dom/monthlyWeekday params; monthly branch now emits monthlyFirstWeekday/everyNMonthFirstWeekday kinds and uses the passed dom instead of hardcoding 1 - decomposeCustomMeta: extend return type with dom/monthlyKind/monthlyWeekday; all four existing monthly cases now extract dom and set monthlyKind; add cases for monthlyFirstWeekday and everyNMonthFirstWeekday - spec: add 11 tests covering buildMeta, decompose, and round-trip for new kinds Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fix test label Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new CalendarRepeatService (pure TypeScript) intended to centralize calendar repeat-rule meta construction, serialization, label formatting, and occurrence enumeration, along with a large Jasmine spec suite and accompanying design/plan documentation for monthly repeat sub-types.
Changes:
- Introduces
calendar-repeat.service.tsimplementing repeat option building, meta (de)composition, backend task reconstruction, and occurrence generation. - Adds extensive unit tests for repeat meta serialization, reconstruction, and date re-anchoring behavior.
- Adds design/spec documentation for monthly repeat sub-type UI behavior and implementation plan.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar/services/calendar-repeat.service.ts | New repeat service with meta building/serialization + occurrence generation + task reconstruction (but currently missing required dependencies and incomplete handling for new monthly kinds). |
| eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar/services/calendar-repeat.service.spec.ts | New/expanded unit test suite covering repeat behaviors and regressions (contains timezone-dependent date parsing). |
| docs/superpowers/specs/2026-06-06-monthly-repeat-options-design.md | Design doc describing intended UX/data-model for monthly repeat sub-types. |
| docs/superpowers/plans/2026-06-06-monthly-repeat-options.md | Implementation plan for monthly repeat sub-types across service + modal + i18n. |
Comment on lines
+1
to
+4
| import {Injectable} from '@angular/core'; | ||
| import {TranslateService} from '@ngx-translate/core'; | ||
| import {CalendarRepeatMeta, CalendarTaskModel} from '../../../models/calendar'; | ||
| import {getCurrentLocale} from './calendar-locale.helper'; |
Comment on lines
+217
to
+218
| case 'monthlyByDay': | ||
| case 'everyNMonthByDay': { |
Comment on lines
+416
to
+417
| case 'monthlyByDay': | ||
| case 'everyNMonthByDay': { |
Comment on lines
+307
to
+320
| { | ||
| value: 'monthlyByDay', | ||
| label: this.translate.instant('Monthly on the {{ordinal}} {{day}}', { | ||
| ordinal: this.formatOrdinal(Math.ceil(dom / 7), currentLang), | ||
| day: currentLang === 'da' ? dayName.toLowerCase() : dayName, | ||
| }), | ||
| meta: { | ||
| kind: 'monthlyByDay', | ||
| ordinalWeek: Math.ceil(dom / 7), | ||
| weekday, | ||
| endMode: 'never', | ||
| }, | ||
| }, | ||
| { |
Comment on lines
+5
to
+7
| // Monday 2026-03-16 00:00:00 UTC | ||
| const BASE_DATE = new Date('2026-03-16T00:00:00').getTime(); | ||
|
|
Comment on lines
+777
to
+780
| // New monthly-by-weekday rule: dayOfMonth is 0 (the "no DOM" sentinel). | ||
| if (meta.kind === 'monthlyByDay' || meta.kind === 'everyNMonthByDay') { | ||
| return 0; | ||
| } |
Comment on lines
+789
to
+795
| metaToRepeatOrdinalWeek(meta: CalendarRepeatMeta | null | undefined): number | null { | ||
| if (!meta) return null; | ||
| if (meta.kind === 'monthlyByDay' || meta.kind === 'everyNMonthByDay') { | ||
| return meta.ordinalWeek ?? null; | ||
| } | ||
| return null; | ||
| } |
Member
Author
|
Calendar service changes belong in eform-backendconfiguration-plugin, not in eform-angular-frontend. Closing — covered by microting/eform-backendconfiguration-plugin#965 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CalendarRepeatMetawith two new kinds:monthlyFirstWeekdayandeveryNMonthFirstWeekdaybuildMetaFromCustomConfig: addsmonthlyKind,dom, andmonthlyWeekdayparameters; fixes pre-existing bug wheredomwas always hardcoded to1decomposeCustomMeta: inverse operation — extractsmonthlyKind,dom,monthlyWeekdayfor edit round-tripreanchorMetaToDate: new cases updateweekdaywhen date changes for the two new kindsreconstructMetaFromTask: distinguishesmonthlyFirstWeekday(ordinalWeek=1) frommonthlyByDay(ordinalWeek>1) on task loadTest plan
ng test— all new tests passbuildMetaFromCustomConfigwith monthlyKind=everyNMonthDom emits correct dombuildMetaFromCustomConfigwith monthlyKind=monthlyFirstWeekday emits ordinalWeek=1 + weekdaydecomposeCustomMetaround-trips for all 4 monthly kindsreconstructMetaFromTaskcorrectly distinguishes monthly kinds on reload🤖 Generated with Claude Code