diff options
author | zachdriver <zach@driver.xyz> | 2017-03-07 09:18:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-07 09:18:19 -0800 |
commit | 357cd1b87709ee8094f9cc7fe54b5644e23bc792 (patch) | |
tree | e30852f65f5efde1541f6b2a58ab705f365657be /src/main/scala/xyz/driver/core/database | |
parent | c676b2b3b774d332f9e303a873db5688de657352 (diff) | |
parent | 278b15ce4ac191f3133c6cd9f5a0e36dcb12a7b9 (diff) | |
download | driver-core-0.10.25.tar.gz driver-core-0.10.25.tar.bz2 driver-core-0.10.25.zip |
Merge pull request #23 from drivergroup/zsmith/date-sqlv0.10.25
Remove arithmetic from year component in date conversion. Add unit tests
Diffstat (limited to 'src/main/scala/xyz/driver/core/database')
-rw-r--r-- | src/main/scala/xyz/driver/core/database/package.scala | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/scala/xyz/driver/core/database/package.scala b/src/main/scala/xyz/driver/core/database/package.scala index c88260b..32b240e 100644 --- a/src/main/scala/xyz/driver/core/database/package.scala +++ b/src/main/scala/xyz/driver/core/database/package.scala @@ -23,9 +23,7 @@ package object database { private[database] def dateToSqlDate(date: Date): SqlDate = { val cal = Calendar.getInstance() - cal.set(Calendar.YEAR, date.year - 1900) - cal.set(Calendar.MONTH, date.month) - cal.set(Calendar.DAY_OF_MONTH, date.day) + cal.set(date.year, date.month, date.day, 0, 0, 0) new SqlDate(cal.getTime.getTime) } } |