Make DueDate optional on MilestoneCreaton (#252)

Merge branch 'master' into milestone-DueDate-optional_240

add check again if gitea is older than 1.10.0 ...

Crowdin [2020-01-04] + add Latvian (#253)

update Translators

add Latvian

update Crowdin

Co-authored-by: 6543 <6543@obermui.de>

make DueDate optional on MilestoneCreaton

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
6543 2020-01-14 12:52:34 +00:00 committed by M M Arif
parent b3e67113f5
commit ec62e3cebf

View file

@ -18,6 +18,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.VersionCheck;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.Milestones;
import org.mian.gitnex.util.AppUtil;
@ -117,15 +118,16 @@ public class NewMilestoneActivity extends AppCompatActivity implements View.OnCl
}
}
if(newMilestoneDueDate.equals("")) {
String finalMilestoneDueDate = null;
if(!newMilestoneDueDate.isEmpty()) {
finalMilestoneDueDate = (AppUtil.customDateCombine(AppUtil.customDateFormat(newMilestoneDueDate)));
} else if (VersionCheck.compareVersion("1.10.0", tinyDb.getString("giteaVersion")) > 1) {
// if Gitea version is less than 1.10.0 DueDate is required
Toasty.info(getApplicationContext(), getString(R.string.milestoneDateEmpty));
return;
}
disableProcessButton();
String finalMilestoneDueDate = (AppUtil.customDateCombine(AppUtil.customDateFormat(newMilestoneDueDate)));
createNewMilestone(instanceUrl, Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName, newMilestoneTitle, newMilestoneDescription, finalMilestoneDueDate);
}