org.tigris.scarab.tools
Class Format

java.lang.Object
  extended byorg.tigris.scarab.tools.Format

public class Format
extends java.lang.Object

Takes a date in any format and converts it to the desired format


Field Summary
static java.lang.String DATE_TIME_FMT
          The default date/time format string.
 
Constructor Summary
Format()
           
 
Method Summary
static java.lang.String getDate(java.text.DateFormat format, java.util.Date date)
          Formats the date according to the passed in DateFormat.
static java.lang.String getDate(java.lang.String format, java.util.Date date)
          Formats the date according to the passed in format Uses SimpleDateFormat to do its magic.
static java.lang.String getFileSize(long fileSize)
          Formats a dimension in bytes to the most appropriate size unit (bytes, KB, MB)
static java.lang.String getNow(java.text.SimpleDateFormat format)
          Formats the current date according to the passed in format Uses SimpleDateFormat to do its magic.
static java.lang.String getNow(java.lang.String format)
          Formats the current date according to the passed in format Uses SimpleDateFormat to do its magic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_TIME_FMT

public static final java.lang.String DATE_TIME_FMT
The default date/time format string.

See Also:
Constant Field Values
Constructor Detail

Format

public Format()
Method Detail

getDate

public static java.lang.String getDate(java.text.DateFormat format,
                                       java.util.Date date)
Formats the date according to the passed in DateFormat. This is generally used with SRT.getDateFormat() and in the templates it looks something like this: $format.getDate($scarabR.DateFormat, $issue.CreatedDate)


getDate

public static java.lang.String getDate(java.lang.String format,
                                       java.util.Date date)
Formats the date according to the passed in format Uses SimpleDateFormat to do its magic.


getNow

public static java.lang.String getNow(java.text.SimpleDateFormat format)
Formats the current date according to the passed in format Uses SimpleDateFormat to do its magic.


getNow

public static java.lang.String getNow(java.lang.String format)
Formats the current date according to the passed in format Uses SimpleDateFormat to do its magic.


getFileSize

public static java.lang.String getFileSize(long fileSize)
Formats a dimension in bytes to the most appropriate size unit (bytes, KB, MB)



Copyright © 2000-2004 Tigris.org. All Rights Reserved.