Skip to content

Commit

Permalink
Zim: Fix Android SDK API level error, by @gsantner
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Jan 9, 2022
1 parent c87752a commit 046d0d3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package net.gsantner.markor.format.zimwiki;

import android.app.Activity;
import android.os.Build;
import android.support.annotation.StringRes;
import android.view.HapticFeedbackConstants;
import android.view.View;
Expand Down Expand Up @@ -306,6 +307,9 @@ private void runRenumberOrderedListIfRequired() {
public static String createZimWikiHeaderAndTitleContents(String fileNameWithoutExtension, Date creationDate, String creationDateLinePrefix) {
String creationDateFormatted;
try {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
throw new Exception();
}
creationDateFormatted = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT).format(creationDate);
} catch (Exception e) {
creationDateFormatted = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ", Locale.ROOT).format(creationDate);
Expand Down

0 comments on commit 046d0d3

Please sign in to comment.