KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > suberic > pooka > DateFormatter


1 package net.suberic.pooka;
2 import java.util.*;
3 import java.text.SimpleDateFormat JavaDoc;
4
5
6 /**
7  * This is a little utility class which stores all of the DateFormat classes
8  * that we use.
9  */

10 public class DateFormatter {
11     
12     // the full date. for reply headers such as 'on Friday, Jan 01, 2000,
13
// Greyface <greyface@corporation.co.thud> wrote...'
14
public SimpleDateFormat JavaDoc fullDateFormat;
15
16     // a time today, used in the message table.
17
public SimpleDateFormat JavaDoc todayFormat;
18
19     // a date this past week, so we can just say the day rather than the
20
// full date if we wish.
21
public SimpleDateFormat JavaDoc thisWeekFormat;
22
23     // a short format which shows the full date, but doesn't take up much
24
// room.
25
public SimpleDateFormat JavaDoc shortFormat;
26
27     public DateFormatter() {
28     fullDateFormat = new java.text.SimpleDateFormat JavaDoc(Pooka.getProperty("DateFormat", "EEE, MMM dd, yyyy, hh:mm"));
29     todayFormat = new java.text.SimpleDateFormat JavaDoc(Pooka.getProperty("FolderTable.TodayDateFormat", "HH:mm"));
30     thisWeekFormat = new java.text.SimpleDateFormat JavaDoc(Pooka.getProperty("FolderTable.ThisWeekDateFormat", "EEE HH:mm"));
31     shortFormat = new java.text.SimpleDateFormat JavaDoc(Pooka.getProperty("FolderTable.DefaultDateFormat", "MM/dd/yy HH:mm"));
32
33     }
34
35     
36 }
37
Popular Tags