Extended and fixed timemark code.

This commit is contained in:
Christian P. MOMON 2021-12-31 23:23:29 +01:00
parent 1da2b34734
commit 68bfab5b26

View file

@ -223,42 +223,6 @@ public class TimeMark
return result; return result;
} }
/**
* Month of.
*
* @param date
* the date
* @return the time mark
*/
public static TimeMark monthOf(final LocalDate date)
{
TimeMark result;
String month = date.format(DateTimeFormatter.ofPattern("yyyy-MM", Locale.FRANCE));
result = new TimeMark(month);
//
return result;
}
/**
* Month of.
*
* @param date
* the date
* @return the time mark
*/
public static TimeMark monthOf(final LocalDateTime date)
{
TimeMark result;
String month = date.format(DateTimeFormatter.ofPattern("yyyy-MM", Locale.FRANCE));
result = new TimeMark(month);
//
return result;
}
/** /**
* Month of. * Month of.
* *
@ -277,6 +241,42 @@ public class TimeMark
return result; return result;
} }
/**
* Month of.
*
* @param date
* the date
* @return the time mark
*/
public static TimeMark yearMonthOf(final LocalDate date)
{
TimeMark result;
String month = date.format(DateTimeFormatter.ofPattern("yyyy-MM", Locale.FRANCE));
result = new TimeMark(month);
//
return result;
}
/**
* Month of.
*
* @param date
* the date
* @return the time mark
*/
public static TimeMark yearMonthOf(final LocalDateTime date)
{
TimeMark result;
String month = date.format(DateTimeFormatter.ofPattern("yyyy-MM", Locale.FRANCE));
result = new TimeMark(month);
//
return result;
}
/** /**
* Year of. * Year of.
* *
@ -324,7 +324,7 @@ public class TimeMark
{ {
TimeMark result; TimeMark result;
String yearWeek = date.format(DateTimeFormatter.ofPattern("yyyyWW", Locale.FRANCE)); String yearWeek = date.format(DateTimeFormatter.ofPattern("yyyy-'W'ww", Locale.FRANCE));
result = new TimeMark(yearWeek); result = new TimeMark(yearWeek);
// //
@ -342,7 +342,7 @@ public class TimeMark
{ {
TimeMark result; TimeMark result;
String yearWeek = date.format(DateTimeFormatter.ofPattern("yyyyWW", Locale.FRANCE)); String yearWeek = date.format(DateTimeFormatter.ofPattern("yyyyww", Locale.FRANCE));
result = new TimeMark(yearWeek); result = new TimeMark(yearWeek);
// //