Index: pkg/http_parser/lib/src/http_date.dart |
diff --git a/pkg/http_parser/lib/src/http_date.dart b/pkg/http_parser/lib/src/http_date.dart |
index 47ac547a8fe77df43804e75ad5a0a2af8d9e7f80..ff7c710dc895c2ee081def50a445aea1fc2919e9 100644 |
--- a/pkg/http_parser/lib/src/http_date.dart |
+++ b/pkg/http_parser/lib/src/http_date.dart |
@@ -26,16 +26,17 @@ String formatHttpDate(DateTime date) { |
var buffer = new StringBuffer() |
..write(_WEEKDAYS[date.weekday - 1]) |
..write(", ") |
+ ..write(date.day <= 9 ? "0" : "") |
..write(date.day.toString()) |
..write(" ") |
..write(_MONTHS[date.month - 1]) |
..write(" ") |
..write(date.year.toString()) |
- ..write(date.hour < 9 ? " 0" : " ") |
+ ..write(date.hour <= 9 ? " 0" : " ") |
..write(date.hour.toString()) |
- ..write(date.minute < 9 ? ":0" : ":") |
+ ..write(date.minute <= 9 ? ":0" : ":") |
..write(date.minute.toString()) |
- ..write(date.second < 9 ? ":0" : ":") |
+ ..write(date.second <= 9 ? ":0" : ":") |
..write(date.second.toString()) |
..write(" GMT"); |
return buffer.toString(); |
nweiz
2014/05/09 20:24:31
This code came straight from dart:io, so it's prob
kevmoo
2014/05/09 20:33:02
It looks like it's okay here https://github.com/da
nweiz
2014/05/09 20:39:35
That's still missing a leading zero for the day, i
|