/*
 * Created on Dec 18, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package gov.va.med.esr.ui.util;

import java.util.*;
import java.text.*;

import gov.va.med.esr.common.infra.ImpreciseDate;

/**
 * @author DNS   chenb
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class DisplayFormatter {
	public static SimpleDateFormat dateTimeFormet = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
	public static SimpleDateFormat dateFormet = new SimpleDateFormat("MM/dd/yyyy");
	
	public static String toStringDate(ImpreciseDate date)
	{
		if (date != null)
		{
			if (date.isImprecise() == true)
				return date.getString(); //TODO: change to dd/MM/yyyy
			else
				return toStringDate(date.getDate());
		}
		return null;
	}
	public static String toStringDate(Date date)
	{
		if (date != null)
			return dateFormet.format(date);
		else
			return null;
	}
	public static String toStringDateTime(Date date)
	{
		if (date != null)
			return dateTimeFormet.format(date);
		else
			return null;
	}
	
}
