Skip to content

Commit b328768

Browse files
authored
Merge pull request #154 from Abdul-Hameed-Turntabl/update-localdate
Adding isWeekDay method to LocalDate module
2 parents b330739 + fc496cb commit b328768

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

morphir/sdk/core/src/morphir/sdk/LocalDate.scala

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ object LocalDate {
4747
def diffInYears(fromDate: LocalDate)(toDate: LocalDate): Int =
4848
(YEARS between (fromDate, toDate)).toInt
4949

50+
def isWeekDay(date: LocalDate): Bool =
51+
date.getDayOfWeek.getValue < 6
52+
5053
/** Provides a conversion from a `java.time.LocalDate` to a `morphir.sdk.LocalDate.LocalDate`
5154
*/
5255
implicit def fromJavaTimeLocalDate(

0 commit comments

Comments
 (0)