Skip to content

Commit 53c2190

Browse files
committed
refactor: . reuse createDateField()
1 parent 0c00165 commit 53c2190

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Renderer/TaskFieldRenderer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ function createDateField(className: string, attributeName: string) {
154154
const taskFieldHTMLData: { [c in TaskLayoutComponent]: TaskFieldHTMLData } = {
155155
// NEW_TASK_FIELD_EDIT_REQUIRED
156156
createdDate: createDateField('task-created', 'taskCreated'),
157-
dueDate: new TaskFieldHTMLData('task-due', 'taskDue', TaskFieldHTMLData.dateAttributeCalculator),
158-
startDate: new TaskFieldHTMLData('task-start', 'taskStart', TaskFieldHTMLData.dateAttributeCalculator),
159-
scheduledDate: new TaskFieldHTMLData('task-scheduled', 'taskScheduled', TaskFieldHTMLData.dateAttributeCalculator),
160-
doneDate: new TaskFieldHTMLData('task-done', 'taskDone', TaskFieldHTMLData.dateAttributeCalculator),
161-
cancelledDate: new TaskFieldHTMLData('task-cancelled', 'taskCancelled', TaskFieldHTMLData.dateAttributeCalculator),
157+
dueDate: createDateField('task-due', 'taskDue'),
158+
startDate: createDateField('task-start', 'taskStart'),
159+
scheduledDate: createDateField('task-scheduled', 'taskScheduled'),
160+
doneDate: createDateField('task-done', 'taskDone'),
161+
cancelledDate: createDateField('task-cancelled', 'taskCancelled'),
162162

163163
description: createFieldWithoutDataAttributes('task-description'),
164164
recurrenceRule: createFieldWithoutDataAttributes('task-recurring'),

0 commit comments

Comments
 (0)