From: <pat...@us...> - 2010-03-26 20:12:13
|
Revision: 1064 http://cishell.svn.sourceforge.net/cishell/?rev=1064&view=rev Author: pataphil Date: 2010-03-26 20:12:06 +0000 (Fri, 26 Mar 2010) Log Message: ----------- * Added FileUtilities.extractFileNameWithExtension. * Added JodaDateUtilities. * Not reviewed. Modified Paths: -------------- trunk/core/org.cishell.utilities/META-INF/MANIFEST.MF trunk/core/org.cishell.utilities/src/org/cishell/utilities/FileUtilities.java Added Paths: ----------- trunk/core/org.cishell.utilities/src/org/cishell/utilities/JodaDateUtilities.java Modified: trunk/core/org.cishell.utilities/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.utilities/META-INF/MANIFEST.MF 2010-03-26 18:08:35 UTC (rev 1063) +++ trunk/core/org.cishell.utilities/META-INF/MANIFEST.MF 2010-03-26 20:12:06 UTC (rev 1064) @@ -12,6 +12,13 @@ org.cishell.framework.data, org.cishell.reference.service.metatype, org.cishell.service.database, + org.joda.time, + org.joda.time.base, + org.joda.time.chrono, + org.joda.time.convert, + org.joda.time.field, + org.joda.time.format, + org.joda.time.tz, org.osgi.framework;version="1.4.0", org.osgi.service.log;version="1.3.0", org.osgi.service.metatype;version="1.1.0", Modified: trunk/core/org.cishell.utilities/src/org/cishell/utilities/FileUtilities.java =================================================================== --- trunk/core/org.cishell.utilities/src/org/cishell/utilities/FileUtilities.java 2010-03-26 18:08:35 UTC (rev 1063) +++ trunk/core/org.cishell.utilities/src/org/cishell/utilities/FileUtilities.java 2010-03-26 20:12:06 UTC (rev 1064) @@ -433,4 +433,8 @@ return fileNameWithoutExtension; } + + public static String extractFileNameWithExtension(String fileLabel) { + return extractFileName(fileLabel) + getFileExtension(fileLabel); + } } \ No newline at end of file Added: trunk/core/org.cishell.utilities/src/org/cishell/utilities/JodaDateUtilities.java =================================================================== --- trunk/core/org.cishell.utilities/src/org/cishell/utilities/JodaDateUtilities.java (rev 0) +++ trunk/core/org.cishell.utilities/src/org/cishell/utilities/JodaDateUtilities.java 2010-03-26 20:12:06 UTC (rev 1064) @@ -0,0 +1,22 @@ +package org.cishell.utilities; + +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +public class JodaDateUtilities { + public static String easyDateTimeFormat(String format) { + DateTime currentDateAndTime = new DateTime(); + DateTimeFormatter formatter = DateTimeFormat.forPattern(format); + + return formatter.print(currentDateAndTime); + } + + public static String easyDateFormat() { + return easyDateTimeFormat("MMM dd, yyyy"); + } + + public static String easyDateAndTimeFormat() { + return easyDateTimeFormat("MMM dd, yyyy; hh:mmaa"); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |