diff --git a/app/src/main/java/org/isoron/uhabits/helpers/DateHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/DateHelper.java index b2c300453..81ad27b9a 100644 --- a/app/src/main/java/org/isoron/uhabits/helpers/DateHelper.java +++ b/app/src/main/java/org/isoron/uhabits/helpers/DateHelper.java @@ -25,6 +25,7 @@ import android.text.format.DateFormat; import org.isoron.uhabits.R; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; @@ -155,17 +156,50 @@ public class DateHelper } + /** + * Throughout the code, it is assumed that the weekdays are numbered + * from 0 (Saturday) to 6 (Friday). + * + * see https://github.com/iSoron/uhabits/issues/74 + * + * In the Java Calendar they are numbered from 1 (Sunday) to 7 (Saturday) + * + *
day | dayNumber | wdaysIndex |
---|---|---|
Su | 1 | 1 |
Mo | 2 | 2 |
Tu | 3 | 3 |
We | 4 | 4 |
Th | 5 | 5 |
Fr | 6 | 6 |
Sa | 7 | 0 |