diff options
author | rfevang@chromium.org <rfevang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 04:46:49 +0000 |
---|---|---|
committer | rfevang@chromium.org <rfevang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 04:46:49 +0000 |
commit | 1321288e6c08a26498f57ef43f27778e0cb15282 (patch) | |
tree | 7b968ef1256c6740104062b55af3f90bd67f4285 /base/time_mac.cc | |
parent | 1e8ebce27abc8948772b2db088e9bcb217a539e4 (diff) | |
download | chromium_src-1321288e6c08a26498f57ef43f27778e0cb15282.zip chromium_src-1321288e6c08a26498f57ef43f27778e0cb15282.tar.gz chromium_src-1321288e6c08a26498f57ef43f27778e0cb15282.tar.bz2 |
Fix off-by-one error in the day_of_week field in Time::Explode on mac.
BUG=
TEST= Added unit tests.
Review URL: https://chromiumcodereview.appspot.com/10451084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time_mac.cc')
-rw-r--r-- | base/time_mac.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/time_mac.cc b/base/time_mac.cc index a5720a6..22d4bc8 100644 --- a/base/time_mac.cc +++ b/base/time_mac.cc @@ -96,7 +96,7 @@ void Time::Explode(bool is_local, Exploded* exploded) const { exploded->year = date.year; exploded->month = date.month; - exploded->day_of_week = (cf_day_of_week == 7) ? 0 : cf_day_of_week - 1; + exploded->day_of_week = cf_day_of_week % 7; exploded->day_of_month = date.day; exploded->hour = date.hour; exploded->minute = date.minute; |