Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be787716 authored by Marten Gajda's avatar Marten Gajda
Browse files

use the term "now" when a task is due within +/- 60 seconds

parent 087b0f90
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import java.util.Formatter;
import java.util.Locale;
import java.util.TimeZone;

import org.dmfs.tasks.R;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
@@ -203,6 +205,11 @@ public class DateFormatter
				allDayNow.set(mNow.monthDay, mNow.month, mNow.year);
				return DateUtils.getRelativeTimeSpanString(date.toMillis(false), allDayNow.toMillis(false), DateUtils.DAY_IN_MILLIS).toString();
			}
			else if (Math.abs(mNow.toMillis(false) - date.toMillis(false)) < 60 * 1000)
			{
				// the date is within this minute
				return mContext.getString(R.string.now);
			}
			else
			{
				return DateUtils.getRelativeTimeSpanString(date.toMillis(false), mNow.toMillis(false), DateUtils.MINUTE_IN_MILLIS).toString();