Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0897891
commit 2017497
Showing
8 changed files
with
69 additions
and
14 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/main/scala/pl/jozwik/quillgeneric/quillmacro/quotes/DateQuotes.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package pl.jozwik.quillgeneric.quillmacro.quotes | ||
|
||
import java.time.{ LocalDate, LocalDateTime } | ||
|
||
import io.getquill.context.Context | ||
|
||
trait DateQuotes { | ||
this: Context[_, _] => | ||
|
||
implicit class LocalDateTimeQuotes(left: LocalDateTime) { | ||
def >(right: LocalDateTime) = quote(infix"$left > $right".as[Boolean]) | ||
|
||
def <(right: LocalDateTime) = quote(infix"$left < $right".as[Boolean]) | ||
|
||
def >=(right: LocalDateTime) = quote(infix"$left >= $right".as[Boolean]) | ||
|
||
def <=(right: LocalDateTime) = quote(infix"$left <= $right".as[Boolean]) | ||
} | ||
|
||
implicit class LocalDateQuotes(left: LocalDate) { | ||
def >(right: LocalDate) = quote(infix"$left > $right".as[Boolean]) | ||
|
||
def <(right: LocalDate) = quote(infix"$left < $right".as[Boolean]) | ||
|
||
def >=(right: LocalDate) = quote(infix"$left >= $right".as[Boolean]) | ||
|
||
def <=(right: LocalDate) = quote(infix"$left <= $right".as[Boolean]) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ThisBuild / version := "0.3.2-SNAPSHOT" | ||
ThisBuild / version := "0.3.2" |