Extract time and recurrence field builders from DmfsTaskBuilder#365
Merged
Conversation
Extract AllDayBuilder, StartTimeBuilder, DueBuilder, DurationBuilder, and RecurrenceFieldsBuilder from the inline code in buildTask(). AllDayBuilder takes over the timezone resolution logic previously in DmfsTaskBuilder.getTimeZone(), which is now removed.
…one handling tests to AllDayBuilderTest
17efffa to
b1a3e58
Compare
rfc2822
approved these changes
May 13, 2026
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.
Closes #356. Part of #340.
Extract
AllDayBuilder,StartTimeBuilder,DueBuilder,DurationBuilder, andRecurrenceFieldsBuilderfrom the inline code inDmfsTaskBuilder.buildTask().AllDayBuildertakes over the timezone resolution logic previously inDmfsTaskBuilder.getTimeZone(), which is now removed.RecurrenceFieldsBuilderdelegates toAllDayBuilderto resolve the timezone for RDATE/EXDATE formatting.Each builder has a corresponding unit test.
Note
The tasks contract has a single
TZcolumn for the whole task and someone has to writeTasks.TZ. NeitherStartTimeBuilder(only writesTasks.DTSTART) norDueBuilder(only writesTasks.DUE) set a timezone.AllDayBuilderis the natural fit because:IS_ALLDAYandTZare semantically coupled: an all-day task should haveTZ = null; a timed task needs a concrete timezone — the builder already branches on this distinction.TZapplies globally (to both DTSTART and DUE), so it can't belong to either time-field builder alone.getTimeZone()helper resolves the timezone by inspecting bothdtStartanddue, with a system-default fallback — consistent with the single-TZ-per-task model.