aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-07-08 03:45:36 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2015-07-08 03:45:36 +0200
commitd98a321f66aef8d960c41ee39af062b3ab808196 (patch)
tree220cdd4904e612900c884e7198bdada6142bff9b /OpenKeychain/src/main/java/org/sufficientlysecure
parent4837d4cc5c86a5f5f18cb86300f165cf1b37f4d2 (diff)
downloadopen-keychain-d98a321f66aef8d960c41ee39af062b3ab808196.tar.gz
open-keychain-d98a321f66aef8d960c41ee39af062b3ab808196.tar.bz2
open-keychain-d98a321f66aef8d960c41ee39af062b3ab808196.zip
Simplifications for expiry dialog
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
index f24df4f39..c9fb990a2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
@@ -85,9 +85,9 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
long expiry = getArguments().getLong(ARG_EXPIRY);
final Calendar creationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- creationCal.setTime(new Date(creation * 1000));
+ creationCal.setTimeInMillis(creation * 1000);
Calendar expiryCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- expiryCal.setTime(new Date(expiry * 1000));
+ expiryCal.setTimeInMillis(expiry * 1000);
// date picker works with default time zone, we need to convert from UTC to default timezone
creationCal.setTimeZone(TimeZone.getDefault());
@@ -128,11 +128,8 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
noExpiry.setChecked(false);
expiryLayout.setVisibility(View.VISIBLE);
- // convert from UTC to time zone of device
- Calendar expiryCalTimeZone = (Calendar) expiryCal.clone();
- expiryCalTimeZone.setTimeZone(TimeZone.getDefault());
currentExpiry.setText(DateFormat.getDateFormat(
- getActivity()).format(expiryCalTimeZone.getTime()));
+ getActivity()).format(expiryCal.getTime()));
}
// date picker works based on default time zone