Created
July 11, 2016 18:31
-
-
Save mpcjanssen/0692427eaff00e65949ded859ba511ac to your computer and use it in GitHub Desktop.
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
implicit class BetterDate(x: Date){ | |
def yesterday: Date = { | |
val y = new Date(x.getTime) | |
y.setDate(-1) | |
y | |
} | |
} | |
val today = new Date() | |
val yesterday: Date = today.yesterday |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment