Skip to content

Commit

Permalink
Remove redundant definition of day of week in favor of java.time.DayO…
Browse files Browse the repository at this point in the history
…fWeek
  • Loading branch information
Abhijit Sarkar committed Sep 6, 2024
1 parent b0dba04 commit 067808f
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 111 deletions.
19 changes: 4 additions & 15 deletions exercises/practice/meetup/src/main/scala/Meetup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,9 @@ import Schedule.Schedule

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

def day(dayOfWeek: Int, schedule: Schedule): LocalDate = ???
def day(dayOfWeek: DayOfWeek, schedule: Schedule): LocalDate = ???
}

object Schedule extends Enumeration {
type Schedule = Value
val Teenth, First, Second, Third, Fourth, Last = Value
}

object Meetup {
val Mon = DayOfWeek.MONDAY.getValue
val Tue = DayOfWeek.TUESDAY.getValue
val Wed = DayOfWeek.WEDNESDAY.getValue
val Thu = DayOfWeek.THURSDAY.getValue
val Fri = DayOfWeek.FRIDAY.getValue
val Sat = DayOfWeek.SATURDAY.getValue
val Sun = DayOfWeek.SUNDAY.getValue
}
enum Schedule {
case First, Second, Third, Fourth, Last, Teenth
}
Loading

0 comments on commit 067808f

Please sign in to comment.