Skip to content

Commit

Permalink
Add Locale param to firstDayOfWeekFromLocale function.
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed Jun 3, 2024
1 parent 1c00c3f commit e4afc44
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ fun daysOfWeek(firstDayOfWeek: DayOfWeek = firstDayOfWeekFromLocale()): List<Day
}

/**
* Returns the first day of the week from the default locale.
* Returns the first day of the week from the provided locale.
*/
fun firstDayOfWeekFromLocale(): DayOfWeek = WeekFields.of(Locale.getDefault()).firstDayOfWeek
@JvmOverloads
fun firstDayOfWeekFromLocale(locale: Locale = Locale.getDefault()): DayOfWeek = WeekFields.of(locale).firstDayOfWeek

/**
* Returns a [LocalDate] at the start of the month.
Expand Down

0 comments on commit e4afc44

Please sign in to comment.