Clean and add comments

This commit is contained in:
jacques 2020-09-19 18:05:00 +02:00
parent dd08171f46
commit 94fc76e179

View file

@ -18,13 +18,12 @@ class UtilDate {
/** /**
* @param aDate anydate * @param aDate anydate
* @return date the same date as input but at noon (12:00:00) * @return date the same date as input but at noon (12:00:00 PM)
* <p>
* set date time at Noon * set date time at Noon
*/ */
static Date dateAtNoon(Date aDate) { static Date dateAtNoon(Date aDate) {
// Log.d(TAG, "dateAtNoon " + aDate); Log.d(TAG, "dateAtNoon " + aDate);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(aDate); calendar.setTime(aDate);
@ -39,7 +38,6 @@ class UtilDate {
* @param days number of days to remove to the ate * @param days number of days to remove to the ate
* @param date date before day removing * @param date date before day removing
* @return date * @return date
* <p>
* Substract days to date and return a new date * Substract days to date and return a new date
*/ */
static Date removeDaysToDate(int days, Date date) { static Date removeDaysToDate(int days, Date date) {
@ -53,7 +51,6 @@ class UtilDate {
/** /**
* @param date Date to be converted * @param date Date to be converted
* @return String of the converted date * @return String of the converted date
* <p>
* Convert a date to a String using a SimpleDateFormat * Convert a date to a String using a SimpleDateFormat
*/ */
static String date2String(Date date, DateFormat dateFormat) { static String date2String(Date date, DateFormat dateFormat) {
@ -69,7 +66,6 @@ class UtilDate {
/** /**
* @param dateString string representing a Date to be converted * @param dateString string representing a Date to be converted
* @return date Date after conversion * @return date Date after conversion
* <p>
* Convert String date into Date * Convert String date into Date
*/ */
static Date string2Date(String dateString) { static Date string2Date(String dateString) {
@ -81,7 +77,6 @@ class UtilDate {
/** /**
* @param date start date * @param date start date
* @return int numbers of days between date and today * @return int numbers of days between date and today
* <p>
* Number of days between date (older than today) and today * Number of days between date (older than today) and today
*/ */
static int nbOfDaysBetweenDateAndToday(Date date) { static int nbOfDaysBetweenDateAndToday(Date date) {
@ -91,6 +86,11 @@ class UtilDate {
return (int) (todayDate.getTime() - oldDate.getTime()); return (int) (todayDate.getTime() - oldDate.getTime());
} }
/**
* Convert dateInMilliseconds into string formated date
* @param dateInMilliseconds long
* @return formatted Date String
*/
static String convertDate(long dateInMilliseconds) { static String convertDate(long dateInMilliseconds) {
DateFormat formatter = new SimpleDateFormat("dd/MM/yy HH:mm:ss", Locale.FRANCE); DateFormat formatter = new SimpleDateFormat("dd/MM/yy HH:mm:ss", Locale.FRANCE);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();