-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.js
More file actions
50 lines (49 loc) · 1.22 KB
/
Event.js
File metadata and controls
50 lines (49 loc) · 1.22 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
//
// I hope you like this education example.
// Visit https://solcode.net
// More cool information on our social sites
// Facebook: https://www.facebook.com/solcodeOfficial/
// Instagram: https://www.instagram.com/solcode_solutions/
//
//
// Class that represents Event object
// requires name, start && end time, start && end date for constructing
class Event {
// constructor
constructor(name, startTime, endTime, startDate, endDate) {
this.name = name;
this.startTime = startTime;
this.endTime = endTime;
this.startDate = startDate;
}
// getters for properties
// gets name
getName() {
return this.name;
}
// gets start time
getStartTime () {
return this.startTime + ":00";
}
// gets end time
getEndTime() {
return this.endTime + ":00";
}
// gets time range
getTimeRange() {
return this.startTime + " - " + this.endTime;
}
// gets start date
getStartDate() {
return this.startDate;
}
// gets end date
getEndDate() {
return this.endDate;
}
// gets date range
getDateRange() {
return this.startDate + " - " + this.endDate;
}
}