Skip to content

Commit 067808f

Browse files
author
Abhijit Sarkar
committed
Remove redundant definition of day of week in favor of java.time.DayOfWeek
1 parent b0dba04 commit 067808f

File tree

2 files changed

+100
-111
lines changed

2 files changed

+100
-111
lines changed

exercises/practice/meetup/src/main/scala/Meetup.scala

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,9 @@ import Schedule.Schedule
44

55
case class Meetup(month: Int, year: Int) {
66

7-
def day(dayOfWeek: Int, schedule: Schedule): LocalDate = ???
7+
def day(dayOfWeek: DayOfWeek, schedule: Schedule): LocalDate = ???
88
}
99

10-
object Schedule extends Enumeration {
11-
type Schedule = Value
12-
val Teenth, First, Second, Third, Fourth, Last = Value
13-
}
14-
15-
object Meetup {
16-
val Mon = DayOfWeek.MONDAY.getValue
17-
val Tue = DayOfWeek.TUESDAY.getValue
18-
val Wed = DayOfWeek.WEDNESDAY.getValue
19-
val Thu = DayOfWeek.THURSDAY.getValue
20-
val Fri = DayOfWeek.FRIDAY.getValue
21-
val Sat = DayOfWeek.SATURDAY.getValue
22-
val Sun = DayOfWeek.SUNDAY.getValue
23-
}
10+
enum Schedule {
11+
case First, Second, Third, Fourth, Last, Teenth
12+
}

0 commit comments

Comments
 (0)