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

Unified Diff: pkg/intl/lib/src/date_format_field.dart

Issue 23494030: Fix off-by-one error in computing the quarter in date formatting (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « no previous file | pkg/intl/test/date_time_format_test_core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/src/date_format_field.dart
diff --git a/pkg/intl/lib/src/date_format_field.dart b/pkg/intl/lib/src/date_format_field.dart
index 08afc045765d650c5ebc2425a7116fd53712089f..fb8274ce1095f8b1c92db7fd241892028b6a60dd 100644
--- a/pkg/intl/lib/src/date_format_field.dart
+++ b/pkg/intl/lib/src/date_format_field.dart
@@ -345,7 +345,7 @@ class _DateFormatPatternField extends _DateFormatField {
}
String formatQuarter(DateTime date) {
- var quarter = (date.month / 3).truncate();
+ var quarter = ((date.month - 1) / 3).truncate();
if (width < 4) {
return symbols.SHORTQUARTERS[quarter];
} else {
« no previous file with comments | « no previous file | pkg/intl/test/date_time_format_test_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698