Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue #1280: Adding noTime tests.

  • Loading branch information...
commit 6d55cd38d5c22b727af99ae5da4c35c06780720d 1 parent daee7f9
@tuhlmann tuhlmann authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 core/util/src/test/scala/net/liftweb/util/TimeHelpersSpec.scala
View
6 core/util/src/test/scala/net/liftweb/util/TimeHelpersSpec.scala
@@ -128,6 +128,12 @@ object TimeHelpersSpec extends Specification("TimeHelpers Specification") with S
"provide a noTime function on Date objects to transform a date into a date at the same day but at 00:00" in {
hourFormat(timeNow.noTime) must_== "00:00:00"
}
+
+ "make sure noTime does not change the day" in {
+ dateFormatter.format(0.days.ago.noTime) must_== dateFormatter.format(new Date())
+ dateFormatter.format(3.days.ago.noTime) must_== dateFormatter.format(new Date(millis - (3 * 24 * 60 * 60 * 1000)))
+ }
+
"provide a day function returning the day of month corresponding to a given date (relative to UTC)" in {
day(today.setTimezone(utc).setDay(3).getTime) must_== 3
}
Please sign in to comment.
Something went wrong with that request. Please try again.