From 541d438097f133ad48253e0bba518ca368c7cdc9 Mon Sep 17 00:00:00 2001 From: zdy Date: Wed, 11 Nov 2015 17:43:00 +0800 Subject: [PATCH] =?UTF-8?q?*=20fix=20bug=20=E5=9C=A84.3=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=8A=E5=BD=93=E5=88=87=E6=8D=A2=E6=97=A5=E6=9C=9F=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E2038=E5=B9=B4=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=B7=B3=E8=BD=AC=E5=88=B01970?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix bug 在4.3系统上当切换日期大于2038年的时候会直接跳转到1970。抱歉第一次提交错了 --- .../java/com/roomorama/caldroid/CaldroidFragment.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/caldroid/src/main/java/com/roomorama/caldroid/CaldroidFragment.java b/caldroid/src/main/java/com/roomorama/caldroid/CaldroidFragment.java index d69f094..dab4dc4 100644 --- a/caldroid/src/main/java/com/roomorama/caldroid/CaldroidFragment.java +++ b/caldroid/src/main/java/com/roomorama/caldroid/CaldroidFragment.java @@ -93,10 +93,6 @@ public class CaldroidFragment extends DialogFragment { private static final int MONTH_YEAR_FLAG = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_MONTH_DAY | DateUtils.FORMAT_SHOW_YEAR; - /** - * First day of month time - */ - private Time firstMonthTime = new Time(); /** * Reuse formatter to print "MMMM yyyy" format @@ -1024,10 +1020,9 @@ public boolean onItemLongClick(AdapterView parent, */ protected void refreshMonthTitleTextView() { // Refresh title view - firstMonthTime.year = year; - firstMonthTime.month = month - 1; - firstMonthTime.monthDay = 15; - long millis = firstMonthTime.toMillis(true); + Calendar c2 = Calendar.getInstance(); + c2.set(year, month - 1, 15, 0, 0, 0); + long millis = c2.getTimeInMillis(); // This is the method used by the platform Calendar app to get a // correctly localized month name for display on a wall calendar