Skip to content

Commit

Permalink
Backporting switch Assets serving timezone from UTC to GMT
Browse files Browse the repository at this point in the history
Conflicts:

	framework/test/integrationtest/test/FunctionalSpec.scala
  • Loading branch information
ph2734 committed Jul 13, 2012
1 parent 3e9ccf3 commit c655a72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ import collection.JavaConverters._
*/
object Assets extends Controller {

private val timeZoneCode = "GMT"

//Dateformatter is immutable and threadsafe
private val df: DateTimeFormatter =
DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss zzz").withLocale(java.util.Locale.ENGLISH).withZoneUTC
DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss '"+timeZoneCode+"'").withLocale(java.util.Locale.ENGLISH).withZone(DateTimeZone.forID(timeZoneCode))

//Dateformatter is immutable and threadsafe
private val dfp: DateTimeFormatter =
DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss").withLocale(java.util.Locale.ENGLISH).withZoneUTC
DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss").withLocale(java.util.Locale.ENGLISH).withZone(DateTimeZone.forID(timeZoneCode))

private val parsableTimezoneCode = " "+dfp.getZone
private val parsableTimezoneCode = " "+timeZoneCode

/**
* Generates an `Action` that serves a static resource.
Expand Down
4 changes: 2 additions & 2 deletions framework/test/integrationtest/test/FunctionalSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class FunctionalSpec extends Specification {
"pass functional test" in {
running(TestServer(9001), HTMLUNIT) { browser =>
// -- Etags

val format = new java.text.SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", java.util.Locale.ENGLISH)
format.setTimeZone(java.util.TimeZone.getTimeZone("UTC"))
format.setTimeZone(java.util.TimeZone.getTimeZone("GMT"))
val h = await(WS.url("http://localhost:9001/public/stylesheets/main.css").get)
h.header("Last-Modified").isDefined must equalTo(true)
h.header("Etag").get.startsWith("\"") must equalTo(true)
Expand Down

0 comments on commit c655a72

Please sign in to comment.