/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }
/** * Given a day, returns just the name to use for that day. * E.g "today", "tomorrow", "Wednesday". * * @param context Context to use for resource localization * @param dateInMillis The date in milliseconds (local time) * * @return the string day of the week */ private static String getDayName(Context context, long dateInMillis) { /* * If the date is today, return the localized version of "Today" instead of the actual * day name. */ long dayNumber = getDayNumber(dateInMillis); long currentDayNumber = getDayNumber(System.currentTimeMillis()); if (dayNumber == currentDayNumber) { return context.getString(R.string.today); } else if (dayNumber == currentDayNumber + 1) { return context.getString(R.string.tomorrow); } else { /* * Otherwise, if the day is not today, the format is just the day of the week * (e.g "Wednesday") */ SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE"); return dayFormat.format(dateInMillis); } } }