Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: sdk/lib/io/http_utils.dart

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http_session.dart ('k') | sdk/lib/io/secure_socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_utils.dart
diff --git a/sdk/lib/io/http_utils.dart b/sdk/lib/io/http_utils.dart
index 45ac5a9675520e34acc57ccab4226336acea5b17..a68f08f68452a60383a7657c7bb65b2750fbd4cd 100644
--- a/sdk/lib/io/http_utils.dart
+++ b/sdk/lib/io/http_utils.dart
@@ -97,12 +97,12 @@ class _HttpUtils {
// | "Sep" | "Oct" | "Nov" | "Dec"
// Format as RFC 1123 date.
- static String formatDate(Date date) {
+ static String formatDate(DateTime date) {
const List wkday = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const List month = const ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
- Date d = date.toUtc();
+ DateTime d = date.toUtc();
StringBuffer sb = new StringBuffer();
sb.add(wkday[d.weekday - 1]);
sb.add(", ");
@@ -121,7 +121,7 @@ class _HttpUtils {
return sb.toString();
}
- static Date parseDate(String date) {
+ static DateTime parseDate(String date) {
final int SP = 32;
const List wkdays = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const List weekdays = const ["Monday", "Tuesday", "Wednesday", "Thursday",
@@ -246,10 +246,10 @@ class _HttpUtils {
expect("GMT");
}
expectEnd();
- return new Date.utc(year, month + 1, day, hours, minutes, seconds, 0);
+ return new DateTime.utc(year, month + 1, day, hours, minutes, seconds, 0);
}
- static Date parseCookieDate(String date) {
+ static DateTime parseCookieDate(String date) {
const List monthsLowerCase = const ["jan", "feb", "mar", "apr", "may",
"jun", "jul", "aug", "sep", "oct",
"nov", "dec"];
@@ -356,6 +356,6 @@ class _HttpUtils {
if (minute > 59) error();
if (second > 59) error();
- return new Date.utc(year, month, dayOfMonth, hour, minute, second, 0);
+ return new DateTime.utc(year, month, dayOfMonth, hour, minute, second, 0);
}
}
« no previous file with comments | « sdk/lib/io/http_session.dart ('k') | sdk/lib/io/secure_socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698