Skip to content
This repository

Expires Header Format added #6

Closed
wants to merge 1 commit into from

2 participants

Martin Murphy Christoph Tavan
Martin Murphy

Like your library. Just wanted to contribute a convenience format to keep me from having to keep looking it up.

I'm not sure if the expires header requires you submit the timezone as GMT (which is equivalent of course to UTC) but I'm not sure if all browsers it requires GMT In the string in order to behave correctly.

Right now "expiresHeaderFormat" would produce a string ending in UTC but otherwise in the correct format assuming you executed it like.

dateFormat(now, "expiresHeader", true)

Christoph Tavan ctavan closed this in b5cad98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 04, 2011
Martin Murphy Added default mask for the Expires header for an HTTP Response 3fc616c
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 13 additions and 12 deletions. Show diff stats Hide diff stats

  1. 25  lib/dateformat.js
25  lib/dateformat.js
@@ -127,18 +127,19 @@ var dateFormat = function () {
127 127
 
128 128
 // Some common format strings
129 129
 dateFormat.masks = {
130  
-	"default":      "ddd mmm dd yyyy HH:MM:ss",
131  
-	shortDate:      "m/d/yy",
132  
-	mediumDate:     "mmm d, yyyy",
133  
-	longDate:       "mmmm d, yyyy",
134  
-	fullDate:       "dddd, mmmm d, yyyy",
135  
-	shortTime:      "h:MM TT",
136  
-	mediumTime:     "h:MM:ss TT",
137  
-	longTime:       "h:MM:ss TT Z",
138  
-	isoDate:        "yyyy-mm-dd",
139  
-	isoTime:        "HH:MM:ss",
140  
-	isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
141  
-	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
  130
+	"default":           "ddd mmm dd yyyy HH:MM:ss",
  131
+	shortDate:           "m/d/yy",
  132
+	mediumDate:          "mmm d, yyyy",
  133
+	longDate:            "mmmm d, yyyy",
  134
+	fullDate:            "dddd, mmmm d, yyyy",
  135
+	shortTime:           "h:MM TT",
  136
+	mediumTime:          "h:MM:ss TT",
  137
+	longTime:            "h:MM:ss TT Z",
  138
+	isoDate:             "yyyy-mm-dd",
  139
+	isoTime:             "HH:MM:ss",
  140
+	isoDateTime:         "yyyy-mm-dd'T'HH:MM:ss",
  141
+	isoUtcDateTime:      "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
  142
+	expiresHeaderFormat: "ddd, dd mmm yyyy HH:MM:ss Z"
142 143
 };
143 144
 
144 145
 // Internationalization strings
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.