Skip to content

Commit 0c00165

Browse files
committed
refactor: . extract createDateField()
1 parent f2af62b commit 0c00165

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Renderer/TaskFieldRenderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,13 @@ function createFieldWithoutDataAttributes(className: string) {
147147
);
148148
}
149149

150+
function createDateField(className: string, attributeName: string) {
151+
return new TaskFieldHTMLData(className, attributeName, TaskFieldHTMLData.dateAttributeCalculator);
152+
}
153+
150154
const taskFieldHTMLData: { [c in TaskLayoutComponent]: TaskFieldHTMLData } = {
151155
// NEW_TASK_FIELD_EDIT_REQUIRED
152-
createdDate: new TaskFieldHTMLData('task-created', 'taskCreated', TaskFieldHTMLData.dateAttributeCalculator),
156+
createdDate: createDateField('task-created', 'taskCreated'),
153157
dueDate: new TaskFieldHTMLData('task-due', 'taskDue', TaskFieldHTMLData.dateAttributeCalculator),
154158
startDate: new TaskFieldHTMLData('task-start', 'taskStart', TaskFieldHTMLData.dateAttributeCalculator),
155159
scheduledDate: new TaskFieldHTMLData('task-scheduled', 'taskScheduled', TaskFieldHTMLData.dateAttributeCalculator),

0 commit comments

Comments
 (0)