diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2013-04-07 12:32:25 +0000 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2013-04-07 12:32:25 +0000 |
commit | 83e15ea8e2ac9a2b1b7754eb6eda75437f50d65c (patch) | |
tree | ff1278f35c13a8cae4af96a6dc23b3f72cf8028d /src/net/java/sip/communicator/util | |
parent | 14c78d292ca8c1a228e0c3359532e0f369f8dbf6 (diff) | |
download | jitsi-83e15ea8e2ac9a2b1b7754eb6eda75437f50d65c.zip jitsi-83e15ea8e2ac9a2b1b7754eb6eda75437f50d65c.tar.gz jitsi-83e15ea8e2ac9a2b1b7754eb6eda75437f50d65c.tar.bz2 |
Log dates in all history files as ISO 8601 with timezone
Diffstat (limited to 'src/net/java/sip/communicator/util')
-rw-r--r-- | src/net/java/sip/communicator/util/GuiUtils.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/util/GuiUtils.java b/src/net/java/sip/communicator/util/GuiUtils.java index 8f07475..3217aba 100644 --- a/src/net/java/sip/communicator/util/GuiUtils.java +++ b/src/net/java/sip/communicator/util/GuiUtils.java @@ -215,6 +215,22 @@ public class GuiUtils } /** + * Compares the two dates. The comparison is based only on the day, month + * and year values. Returns 0 if the two dates are equals, a value < 0 if + * the first date is before the second one and > 0 if the first date is + * after the second one. + * @param date1 the first date to compare + * @param date2 the second date to compare with + * @return Returns 0 if the two dates are equals, a value < 0 if + * the first date is before the second one and > 0 if the first date is + * after the second one + */ + public static int compareDatesOnly(Date date1, Date date2) + { + return compareDatesOnly(date1.getTime(), date2.getTime()); + } + + /** * Formats the given date. The result format is the following: * [Month] [Day], [Year]. For example: Dec 24, 2000. * @param date the date to format @@ -258,6 +274,24 @@ public class GuiUtils } /** + * Formats the given date as: Month DD, YYYY and appends it to the given + * <tt>dateStrBuf</tt> string buffer. + * @param date the date to format + * @param dateStrBuf the <tt>StringBuffer</tt>, where to append the + * formatted date + */ + public static void formatDate(Date date, StringBuffer dateStrBuf) + { + c1.setTime(date); + + dateStrBuf.append(GuiUtils.processMonth(c1.get(Calendar.MONTH))); + dateStrBuf.append(' '); + GuiUtils.formatTime(c1.get(Calendar.DAY_OF_MONTH), dateStrBuf); + dateStrBuf.append(", "); + GuiUtils.formatTime(c1.get(Calendar.YEAR), dateStrBuf); + } + + /** * Formats the time for the given date. The result format is the following: * [Hour]:[Minute]:[Second]. For example: 12:25:30. * @param date the date to format |