Repository: obsidian-tasks-group/obsidian-tasks
Pull request #3037 (2024-08-17 15:33:32)

refactor: Introduce 'DateTime/' sub-directories in 'src/' and 'tests/'
# Types of changes

Internal changes:

- [x] **Refactor** (prefix: `refactor` - non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)

## Description

Move all date utility code to:

- `src/DateTime/`
- `tests/DateTime/`

## Motivation and Context

To aid discoverability and reusability of existing code, and prepare for implementing a date-picker tool.

## How has this been tested?

- Existing automated tests.

## Checklist

- [x] My code follows the code style of this project and passes `yarn run lint`.
- [ ] My change requires a change to the documentation.
- [ ] I have [updated the documentation](https://publish.obsidian.md/tasks-contributing/Documentation/About+Documentation) accordingly.
- [x] My change has adequate [Unit Test coverage](https://publish.obsidian.md/tasks-contributing/Testing/About+Testing).

## Terms

- [x] My contribution follows this project's [contributing guide](https://publish.obsidian.md/tasks-contributing)
- [x] I agree to follow this project's [Code of Conduct](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/CODE_OF_CONDUCT.md)



Patch:
diff --git a/src/Commands/CreateOrEdit.ts b/src/Commands/CreateOrEdit.ts
index 6a487540..4c364b72 100644
--- a/src/Commands/CreateOrEdit.ts
+++ b/src/Commands/CreateOrEdit.ts
@@ -1,7 +1,7 @@
 import { App, Editor, MarkdownView, View } from 'obsidian';
 import { TaskModal } from '../Obsidian/TaskModal';
 import type { Task } from '../Task/Task';
-import { DateFallback } from '../Task/DateFallback';
+import { DateFallback } from '../DateTime/DateFallback';
 import { taskFromLine } from './CreateOrEditTaskParser';
 
 export const createOrEdit = (checking: boolean, editor: Editor, view: View, app: App, allTasks: Task[]) => {
diff --git a/src/Commands/CreateOrEditTaskParser.ts b/src/Commands/CreateOrEditTaskParser.ts
index 37a678ad..45b91f84 100644
--- a/src/Commands/CreateOrEditTaskParser.ts
+++ b/src/Commands/CreateOrEditTaskParser.ts
@@ -2,7 +2,7 @@ import { TasksFile } from '../Scripting/TasksFile';
 import { Status } from '../Statuses/Status';
 import { OnCompletion } from '../Task/OnCompletion';
 import { Task } from '../Task/Task';
-import { DateFallback } from '../Task/DateFallback';
+import { DateFallback } from '../DateTime/DateFallback';
 import { StatusRegistry } from '../Statuses/StatusRegistry';
 import { TaskLocation } from '../Task/TaskLocation';
 import { getSettings } from '../Config/Settings';
diff --git a/src/lib/DateAbbreviations.ts b/src/DateTime/DateAbbreviations.ts
similarity index 100%
rename from src/lib/DateAbbreviations.ts
rename to src/DateTime/DateAbbreviations.ts
diff --git a/src/Task/DateFallback.ts b/src/DateTime/DateFallback.ts
similarity index 98%
rename from src/Task/DateFallback.ts
rename to src/DateTime/DateFallback.ts
index e164057d..1db6315b 100644
--- a/src/Task/DateFallback.ts
+++ b/src/DateTime/DateFallback.ts
@@ -1,7 +1,7 @@
 import type { Moment } from 'moment';
 import { getSettings } from '../Config/Settings';
-import type { TaskLocation } from './TaskLocation';
-import { Task } from './Task';
+import type { TaskLocation } from '../Task/TaskLocation';
+import { Task } from '../Task/Task';
 
 /**
  * Implement date from path detection
diff --git a/src/Query/DateParser.ts b/src/DateTime/DateParser.ts
similarity index 100%
rename from src/Query/DateParser.ts
rename to src/DateTime/DateParser.ts
diff --git a/src/Query/DateRange.ts b/src/DateTime/DateRange.ts
similarity index 100%
rename from src/Query/DateRange.ts
rename to src/DateTime/DateRange.ts
diff --git a/src/lib/DateTools.ts b/src/DateTime/DateTools.ts
similarity index 100%
rename from src/lib/DateTools.ts
rename to src/DateTime/DateTools.ts
diff --git a/src/Scripting/Postponer.ts b/src/DateTime/Postponer.ts
similarity index 99%
rename from src/Scripting/Postponer.ts
rename to src/DateTime/Postponer.ts
index d17e2f85..3d11630d 100644
--- a/src/Scripting/Postponer.ts
+++ b/src/DateTime/Postponer.ts
@@ -1,7 +1,7 @@
 import type { Moment, unitOfTime } from 'moment';
 import { capitalizeFirstLetter } from '../lib/StringHelpers';
-import { DateFallback } from '../Task/DateFallback';
 import { Task } from '../Task/Task';
+import { DateFallback } from './DateFallback';
 import { TasksDate } from './TasksDate';
 
 export function shouldShowPostponeButton(task: Task) {
diff --git a/src/Scripting/TasksDate.ts b/src/DateTime/TasksDate.ts
similarity index 100%
rename from src/Scripting/TasksDate.ts
rename to src/DateTime/TasksDate.ts
diff --git a/src/Obsidian/Cache.ts b/src/Obsidian/Cache.ts
index 82dd5daa..e04bb5e3 100644
--- a/src/Obsidian/Cache.ts
+++ b/src/Obsidian/Cache.ts
@@ -6,7 +6,7 @@ import { TasksFile } from '../Scripting/TasksFile';
 import { ListItem } from '../Task/ListItem';
 
 import { Task } from '../Task/Task';
-import { DateFallback } from '../Task/DateFallback';
+import { DateFallback } from '../DateTime/DateFallback';
 import { getSettings } from '../Config/Settings';
 import { Lazy } from '../lib/Lazy';
 import { TaskLocation } from '../Task/TaskLocation';
diff --git a/src/Query/Filter/DateField.ts b/src/Query/Filter/DateField.ts
index 6e499bbf..c6600464 100644
--- a/src/Query/Filter/DateField.ts
+++ b/src/Query/Filter/DateField.ts
@@ -1,10 +1,10 @@
 import type { Moment } from 'moment';
-import { DateRange } from '../DateRange';
+import { DateRange } from '../../DateTime/DateRange';
 import type { Task } from '../../Task/Task';
-import { DateParser } from '../DateParser';
+import { DateParser } from '../../DateTime/DateParser';
 import { Explanation } from '../Explain/Explanation';
 import type { Comparator } from '../Sort/Sorter';
-import { compareByDate } from '../../lib/DateTools';
+import { compareByDate } from '../../DateTime/DateTools';
 import type { GrouperFunction } from '../Group/Grouper';
 import { TemplatingPluginTools } from '../../lib/TemplatingPluginTools';
 import { Field } from './Field';
diff --git a/src/Query/Filter/FunctionField.ts b/src/Query/Filter/FunctionField.ts
index 966d35ad..d3b67e6b 100644
--- a/src/Query/Filter/FunctionField.ts
+++ b/src/Query/Filter/FunctionField.ts
@@ -6,7 +6,7 @@ import { TaskExpression, parseAndEvaluateExpression } from '../../Scripting/Task
 import type { QueryContext } from '../../Scripting/QueryContext';
 import type { SearchInfo } from '../SearchInfo';
 import { Sorter } from '../Sort/Sorter';
-import { compareByDate } from '../../lib/DateTools';
+import { compareByDate } from '../../DateTime/DateTools';
 import { getValueType } from '../../lib/TypeDetection';
 import { Field } from './Field';
 import { Filter, type FilterFunction } from './Filter';
diff --git a/src/Renderer/QueryRenderer.ts b/src/Renderer/QueryRenderer.ts
index 5017ef3e..9f061e40 100644
--- a/src/Renderer/QueryRenderer.ts
+++ b/src/Renderer/QueryRenderer.ts
@@ -8,7 +8,7 @@ import { getTaskLineAndFile, replaceTaskWithTasks } from '../Obsidian/File';
 import { TaskModal } from '../Obsidian/TaskModal';
 import type { TasksEvents } from '../Obsidian/TasksEvents';
 import { TasksFile } from '../Scripting/TasksFile';
-import { DateFallback } from '../Task/DateFallback';
+import { DateFallback } from '../DateTime/DateFallback';
 import type { Task } from '../Task/Task';
 import { QueryResultsRenderer } from './QueryResultsRenderer';
 import { createAndAppendElement } from './TaskLineRenderer';
diff --git a/src/Renderer/QueryResultsRenderer.ts b/src/Renderer/QueryResultsRenderer.ts
index acfe6dff..af1ac573 100644
--- a/src/Renderer/QueryResultsRenderer.ts
+++ b/src/Renderer/QueryResultsRenderer.ts
@@ -10,7 +10,7 @@ import { State } from '../Obsidian/Cache';
 import type { GroupDisplayHeading } from '../Query/Group/GroupDisplayHeading';
 import type { TaskGroups } from '../Query/Group/TaskGroups';
 import type { QueryResult } from '../Query/QueryResult';
-import { postponeButtonTitle, shouldShowPostponeButton } from '../Scripting/Postponer';
+import { postponeButtonTitle, shouldShowPostponeButton } from '../DateTime/Postponer';
 import type { TasksFile } from '../Scripting/TasksFile';
 import type { Task } from '../Task/Task';
 import { PostponeMenu } from '../ui/Menus/PostponeMenu';
diff --git a/src/Suggestor/Suggestor.ts b/src/Suggestor/Suggestor.ts
index ec6de5a4..89261be6 100644
--- a/src/Suggestor/Suggestor.ts
+++ b/src/Suggestor/Suggestor.ts
@@ -1,8 +1,8 @@
 import type { Editor, EditorPosition } from 'obsidian';
 
 import type { Settings } from '../Config/Settings';
-import { DateParser } from '../Query/DateParser';
-import { doAutocomplete } from '../lib/DateAbbreviations';
+import { DateParser } from '../DateTime/DateParser';
+import { doAutocomplete } from '../DateTime/DateAbbreviations';
 import { Occurrence } from '../Task/Occurrence';
 import { Recurrence } from '../Task/Recurrence';
 import {
diff --git a/src/Task/Occurrence.ts b/src/Task/Occurrence.ts
index 6eef55a6..d7bec2e5 100644
--- a/src/Task/Occurrence.ts
+++ b/src/Task/Occurrence.ts
@@ -1,5 +1,5 @@
 import type { Moment } from 'moment/moment';
-import { compareByDate } from '../lib/DateTools';
+import { compareByDate } from '../DateTime/DateTools';
 
 /**
  * A set of dates on a single instance of {@link Recurrence}.
diff --git a/src/Task/Task.ts b/src/Task/Task.ts
index bb77727b..bb262ca3 100644
--- a/src/Task/Task.ts
+++ b/src/Task/Task.ts
@@ -3,14 +3,14 @@ import { getSettings, getUserSelectedTaskFormat } from '../Config/Settings';
 import { GlobalFilter } from '../Config/GlobalFilter';
 import { StatusRegistry } from '../Statuses/StatusRegistry';
 import type { Status } from '../Statuses/Status';
-import { compareByDate } from '../lib/DateTools';
-import { TasksDate } from '../Scripting/TasksDate';
+import { compareByDate } from '../DateTime/DateTools';
+import { TasksDate } from '../DateTime/TasksDate';
 import { StatusType } from '../Statuses/StatusConfiguration';
 import type { TasksFile } from '../Scripting/TasksFile';
 import { PriorityTools } from '../lib/PriorityTools';
 import { logging } from '../lib/logging';
 import { logEndOfTaskEdit, logStartOfTaskEdit } from '../lib/LogTasksHelper';
-import { DateFallback } from './DateFallback';
+import { DateFallback } from '../DateTime/DateFallback';
 import { ListItem } from './ListItem';
 import type { Occurrence } from './Occurrence';
 import { Urgency } from './Urgency';
diff --git a/src/ui/DateEditor.svelte b/src/ui/DateEditor.svelte
index 0f1472fb..5c15eae2 100644
--- a/src/ui/DateEditor.svelte
+++ b/src/ui/DateEditor.svelte
@@ -1,6 +1,6 @@
 <script lang="ts">
-    import { doAutocomplete } from '../lib/DateAbbreviations';
-    import { parseTypedDateForDisplayUsingFutureDate } from '../lib/DateTools';
+    import { doAutocomplete } from '../DateTime/DateAbbreviations';
+    import { parseTypedDateForDisplayUsingFutureDate } from '../DateTime/DateTools';
     import { labelContentWithAccessKey } from './EditTaskHelpers';
 
     export let id: 'start' | 'scheduled' | 'due' | 'done' | 'created' | 'cancelled';
diff --git a/src/ui/EditableTask.ts b/src/ui/EditableTask.ts
index 24b66e3d..d6fd4ec8 100644
--- a/src/ui/EditableTask.ts
+++ b/src/ui/EditableTask.ts
@@ -1,5 +1,5 @@
 import { GlobalFilter } from '../Config/GlobalFilter';
-import { parseTypedDateForSaving } from '../lib/DateTools';
+import { parseTypedDateForSaving } from '../DateTime/DateTools';
 import { replaceTaskWithTasks } from '../Obsidian/File';
 import type { Status } from '../Statuses/Status';
 import type { OnCompletion } from '../Task/OnCompletion';
diff --git a/src/ui/Menus/PostponeMenu.ts b/src/ui/Menus/PostponeMenu.ts
index dd3200f3..c9276b1b 100644
--- a/src/ui/Menus/PostponeMenu.ts
+++ b/src/ui/Menus/PostponeMenu.ts
@@ -11,7 +11,7 @@ import {
     postponeMenuItemTitle,
     postponementSuccessMessage,
     removeDateMenuItemTitle,
-} from '../../Scripting/Postponer';
+} from '../../DateTime/Postponer';
 import { TaskEditingMenu, type TaskSaver, defaultTaskSaver } from './TaskEditingMenu';
 
 type NamingFunction = (task: Task, amount: number, timeUnit: unitOfTime.DurationConstructor) => string;


Test patch:
diff --git a/tests/CustomMatchers/CustomMatchersForSorting.ts b/tests/CustomMatchers/CustomMatchersForSorting.ts
index 6e9f31b2..980640c9 100644
--- a/tests/CustomMatchers/CustomMatchersForSorting.ts
+++ b/tests/CustomMatchers/CustomMatchersForSorting.ts
@@ -1,8 +1,8 @@
 import type moment from 'moment';
-import { DateParser } from '../../src/Query/DateParser';
+import { DateParser } from '../../src/DateTime/DateParser';
 import type { Sorter } from '../../src/Query/Sort/Sorter';
 import type { Task } from '../../src/Task/Task';
-import { compareByDate } from '../../src/lib/DateTools';
+import { compareByDate } from '../../src/DateTime/DateTools';
 import { SearchInfo } from '../../src/Query/SearchInfo';
 import { TasksFile } from '../../src/Scripting/TasksFile';
 
diff --git a/tests/lib/DateAbbreviations.test.ts b/tests/DateTime/DateAbbreviations.test.ts
similarity index 92%
rename from tests/lib/DateAbbreviations.test.ts
rename to tests/DateTime/DateAbbreviations.test.ts
index 64527400..0bcf81d7 100644
--- a/tests/lib/DateAbbreviations.test.ts
+++ b/tests/DateTime/DateAbbreviations.test.ts
@@ -1,4 +1,4 @@
-import { doAutocomplete } from '../../src/lib/DateAbbreviations';
+import { doAutocomplete } from '../../src/DateTime/DateAbbreviations';
 
 describe('DateAbbreviations', () => {
     it('should expand abbreviations', () => {
diff --git a/tests/Task/DateFallback.test.ts b/tests/DateTime/DateFallback.test.ts
similarity index 99%
rename from tests/Task/DateFallback.test.ts
rename to tests/DateTime/DateFallback.test.ts
index 2b1aa0b9..e68141c6 100644
--- a/tests/Task/DateFallback.test.ts
+++ b/tests/DateTime/DateFallback.test.ts
@@ -6,7 +6,7 @@ import moment from 'moment';
 import { TasksFile } from '../../src/Scripting/TasksFile';
 import { Task } from '../../src/Task/Task';
 import { resetSettings, updateSettings } from '../../src/Config/Settings';
-import { DateFallback } from '../../src/Task/DateFallback';
+import { DateFallback } from '../../src/DateTime/DateFallback';
 import { TaskLocation } from '../../src/Task/TaskLocation';
 import { TaskBuilder } from '../TestingTools/TaskBuilder';
 
@@ -416,7 +416,6 @@ describe('update fallback date when path is changed', () => {
             expect(updatedTask.scheduledDate).toBeNull();
         } else {
             expect(updatedTask.scheduledDate).toEqualMoment(expectedScheduledDate);
-            true;
         }
 
         expect(updatedTask.scheduledDateIsInferred).toBe(expectedIsInferred);
diff --git a/tests/Query/DateParser.test.ts b/tests/DateTime/DateParser.test.ts
similarity index 99%
rename from tests/Query/DateParser.test.ts
rename to tests/DateTime/DateParser.test.ts
index 6e3605f4..9c0b0a37 100644
--- a/tests/Query/DateParser.test.ts
+++ b/tests/DateTime/DateParser.test.ts
@@ -2,7 +2,7 @@
  * @jest-environment jsdom
  */
 import moment from 'moment';
-import { DateParser } from '../../src/Query/DateParser';
+import { DateParser } from '../../src/DateTime/DateParser';
 
 import { TaskRegularExpressions } from '../../src/Task/TaskRegularExpressions';
 
diff --git a/tests/Query/DateRange.test.ts b/tests/DateTime/DateRange.test.ts
similarity index 98%
rename from tests/Query/DateRange.test.ts
rename to tests/DateTime/DateRange.test.ts
index 837ef485..3be78670 100644
--- a/tests/Query/DateRange.test.ts
+++ b/tests/DateTime/DateRange.test.ts
@@ -3,7 +3,7 @@
  */
 
 import moment from 'moment';
-import { DateRange } from '../../src/Query/DateRange';
+import { DateRange } from '../../src/DateTime/DateRange';
 
 window.moment = moment;
 
diff --git a/tests/lib/DateTools.test.ts b/tests/DateTime/DateTools.test.ts
similarity index 100%
rename from tests/lib/DateTools.test.ts
rename to tests/DateTime/DateTools.test.ts
diff --git a/tests/Scripting/Postponer.test.ts b/tests/DateTime/Postponer.test.ts
similarity index 99%
rename from tests/Scripting/Postponer.test.ts
rename to tests/DateTime/Postponer.test.ts
index f6945180..99dfb040 100644
--- a/tests/Scripting/Postponer.test.ts
+++ b/tests/DateTime/Postponer.test.ts
@@ -15,7 +15,7 @@ import {
     postponementSuccessMessage,
     removeDateMenuItemTitle,
     shouldShowPostponeButton,
-} from '../../src/Scripting/Postponer';
+} from '../../src/DateTime/Postponer';
 import { Status } from '../../src/Statuses/Status';
 import { StatusConfiguration, StatusType } from '../../src/Statuses/StatusConfiguration';
 import type { PostponingFunction } from '../../src/ui/Menus/PostponeMenu';
diff --git a/tests/Scripting/TasksDate.test.ts b/tests/DateTime/TasksDate.test.ts
similarity index 99%
rename from tests/Scripting/TasksDate.test.ts
rename to tests/DateTime/TasksDate.test.ts
index 97956ad3..38b570a1 100644
--- a/tests/Scripting/TasksDate.test.ts
+++ b/tests/DateTime/TasksDate.test.ts
@@ -5,7 +5,7 @@
 import moment from 'moment';
 
 import type { unitOfTime } from 'moment/moment';
-import { TasksDate } from '../../src/Scripting/TasksDate';
+import { TasksDate } from '../../src/DateTime/TasksDate';
 
 window.moment = moment;
 
diff --git a/tests/Query/Filter/FunctionField.test.ts b/tests/Query/Filter/FunctionField.test.ts
index 76719864..60e9cb85 100644
--- a/tests/Query/Filter/FunctionField.test.ts
+++ b/tests/Query/Filter/FunctionField.test.ts
@@ -20,7 +20,7 @@ import {
 } from '../../CustomMatchers/CustomMatchersForSorting';
 import { fromLine } from '../../TestingTools/TestHelpers';
 import { Query } from '../../../src/Query/Query';
-import { TasksDate } from '../../../src/Scripting/TasksDate';
+import { TasksDate } from '../../../src/DateTime/TasksDate';
 import { Priority } from '../../../src/Task/Priority';
 import { TasksFile } from '../../../src/Scripting/TasksFile';
 
diff --git a/tests/Renderer/TaskLineRenderer.test.ts b/tests/Renderer/TaskLineRenderer.test.ts
index 2ba78e30..85824acd 100644
--- a/tests/Renderer/TaskLineRenderer.test.ts
+++ b/tests/Renderer/TaskLineRenderer.test.ts
@@ -8,7 +8,7 @@ import { GlobalFilter } from '../../src/Config/GlobalFilter';
 import { resetSettings, updateSettings } from '../../src/Config/Settings';
 import { QueryLayoutOptions } from '../../src/Layout/QueryLayoutOptions';
 import { TaskLayoutComponent, TaskLayoutOptions, taskLayoutComponents } from '../../src/Layout/TaskLayoutOptions';
-import { DateParser } from '../../src/Query/DateParser';
+import { DateParser } from '../../src/DateTime/DateParser';
 import type { TextRenderer } from '../../src/Renderer/TaskLineRenderer';
 import { TaskLineRenderer } from '../../src/Renderer/TaskLineRenderer';
 import type { Task } from '../../src/Task/Task';
diff --git a/tests/Scripting/ScriptingTestHelpers.ts b/tests/Scripting/ScriptingTestHelpers.ts
index 77684a02..b43444e9 100644
--- a/tests/Scripting/ScriptingTestHelpers.ts
+++ b/tests/Scripting/ScriptingTestHelpers.ts
@@ -1,5 +1,5 @@
 import moment from 'moment';
-import { TasksDate } from '../../src/Scripting/TasksDate';
+import { TasksDate } from '../../src/DateTime/TasksDate';
 import { TaskRegularExpressions } from '../../src/Task/TaskRegularExpressions';
 import { Task } from '../../src/Task/Task';
 
diff --git a/tests/Task/Task.test.ts b/tests/Task/Task.test.ts
index 3494b0f6..b60c951b 100644
--- a/tests/Task/Task.test.ts
+++ b/tests/Task/Task.test.ts
@@ -18,7 +18,7 @@ import { RecurrenceBuilder } from '../TestingTools/RecurrenceBuilder';
 import { Priority } from '../../src/Task/Priority';
 import { SampleTasks } from '../TestingTools/SampleTasks';
 import { booleanToEmoji } from '../TestingTools/FilterTestHelpers';
-import type { TasksDate } from '../../src/Scripting/TasksDate';
+import type { TasksDate } from '../../src/DateTime/TasksDate';
 import { example_kanban } from '../Obsidian/__test_data__/example_kanban';
 import { jason_properties } from '../Obsidian/__test_data__/jason_properties';
 import { OnCompletion } from '../../src/Task/OnCompletion';
diff --git a/tests/TestingTools/DateTestHelpers.ts b/tests/TestingTools/DateTestHelpers.ts
index 20d5512d..1f138931 100644
--- a/tests/TestingTools/DateTestHelpers.ts
+++ b/tests/TestingTools/DateTestHelpers.ts
@@ -1,4 +1,4 @@
-import { DateParser } from '../../src/Query/DateParser';
+import { DateParser } from '../../src/DateTime/DateParser';
 
 /**
  * Create a date string that is a certain number of days away from the given date.
diff --git a/tests/TestingTools/RecurrenceBuilder.ts b/tests/TestingTools/RecurrenceBuilder.ts
index 0e2f92d0..e605fe7f 100644
--- a/tests/TestingTools/RecurrenceBuilder.ts
+++ b/tests/TestingTools/RecurrenceBuilder.ts
@@ -2,7 +2,7 @@
 import type { Moment } from 'moment';
 import { Occurrence } from '../../src/Task/Occurrence';
 import { Recurrence } from '../../src/Task/Recurrence';
-import { DateParser } from '../../src/Query/DateParser';
+import { DateParser } from '../../src/DateTime/DateParser';
 
 /**
  * A fluent class for creating Recurrence objects for tests.
diff --git a/tests/TestingTools/TaskBuilder.ts b/tests/TestingTools/TaskBuilder.ts
index d9058299..e8ae1547 100644
--- a/tests/TestingTools/TaskBuilder.ts
+++ b/tests/TestingTools/TaskBuilder.ts
@@ -6,7 +6,7 @@ import { OnCompletion } from '../../src/Task/OnCompletion';
 import { Occurrence } from '../../src/Task/Occurrence';
 import { Task } from '../../src/Task/Task';
 import { Recurrence } from '../../src/Task/Recurrence';
-import { DateParser } from '../../src/Query/DateParser';
+import { DateParser } from '../../src/DateTime/DateParser';
 import { StatusConfiguration, StatusType } from '../../src/Statuses/StatusConfiguration';
 import { TaskLocation } from '../../src/Task/TaskLocation';
 import { Priority } from '../../src/Task/Priority';
diff --git a/tests/lib/TypeDetection.test.ts b/tests/lib/TypeDetection.test.ts
index 54691ee1..edb3af6a 100644
--- a/tests/lib/TypeDetection.test.ts
+++ b/tests/lib/TypeDetection.test.ts
@@ -1,7 +1,7 @@
 import moment from 'moment';
 
 import { getValueType } from '../../src/lib/TypeDetection';
-import { TasksDate } from '../../src/Scripting/TasksDate';
+import { TasksDate } from '../../src/DateTime/TasksDate';
 
 describe('getValueType', () => {
     it('should name values correctly', () => {
diff --git a/tests/ui/EditTask.test.ts b/tests/ui/EditTask.test.ts
index 96f179a8..bfb3a8fb 100644
--- a/tests/ui/EditTask.test.ts
+++ b/tests/ui/EditTask.test.ts
@@ -7,7 +7,7 @@ import { taskFromLine } from '../../src/Commands/CreateOrEditTaskParser';
 import { GlobalFilter } from '../../src/Config/GlobalFilter';
 import { resetSettings, updateSettings } from '../../src/Config/Settings';
 import { StatusRegistry } from '../../src/Statuses/StatusRegistry';
-import { DateFallback } from '../../src/Task/DateFallback';
+import { DateFallback } from '../../src/DateTime/DateFallback';
 import type { Task } from '../../src/Task/Task';
 import EditTask from '../../src/ui/EditTask.svelte';
 import { verifyWithFileExtension } from '../TestingTools/ApprovalTestHelpers';