Package org.notima.util
Class LocalDateUtils
java.lang.Object
org.notima.util.LocalDateUtils
Converts between Date and LocalDate
- Author:
- Lokesh Gupta, Daniel Tamm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Datestatic DateasDate(LocalDateTime localDateTime) static LocalDateasLocalDate(Date date) static LocalDateTimeasLocalDateTime(Date date) static StringgetDateRangeStr(Date startDate, Date endDate, DateFormat dtf, String rangeSeparator) Prints a date range string using dash '_' as default range indicator.
-
Constructor Details
-
LocalDateUtils
public LocalDateUtils()
-
-
Method Details
-
asDate
-
asDate
-
asLocalDate
-
asLocalDateTime
-
getDateRangeStr
public static String getDateRangeStr(Date startDate, Date endDate, DateFormat dtf, String rangeSeparator) Prints a date range string using dash '_' as default range indicator. If start and end date are the same, only one date is printed. If both dates are null, an empty string is returned.- Parameters:
startDate- Start dateendDate- End datedtf- DateFormat. If none is selected (null), default locale (short) is used.rangeSeparator- Separates the start date from the end date. If null, _ is used.- Returns:
- The date range as a string.
-