There is a method and briefly about it:
String fromDateString = DateTools.formatToLongDateFormat(datePeriod.startDate); String toDateString = DateTools.formatToLongDateFormat(datePeriod.endDate); Then I write the conditions under which my values are equal.
if (datePeriod.startDate.isEqual(datePeriod.endDate)) { return fromDateString; } And what turns out, instead of two dates, I get one, but the essence is not important, the essence is that the task is that when this condition is met, namely when starDate = endDate, besides return fromDateString; An additional text value TODAY was displayed.