-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.js
More file actions
32 lines (26 loc) · 801 Bytes
/
Copy pathtask.js
File metadata and controls
32 lines (26 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class Task {
constructor(id, description, status, createdAt, updatedAt) {
this.id = id;
this.description = description;
this.status = status;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
setDescription(description) {
this.description = description
}
setStatus(status) {
this.status = status;
}
setUpdatedAt(date) {
this.updatedAt = date;
}
toString() {
return `Task ID: ${this.id}\n` +
`Description: ${this.description}\n` +
`Status: ${this.status}\n` +
`Created at: ${this.createdAt.toLocaleString()}\n` +
`Updated at: ${this.updatedAt ? this.updatedAt.toLocaleString() : 'N/A'}\n`;
}
}
module.exports = Task;