Example usage for org.jfree.data.time Day DATE_FORMAT

List of usage examples for org.jfree.data.time Day DATE_FORMAT

Introduction

In this page you can find the example usage for org.jfree.data.time Day DATE_FORMAT.

Prototype

DateFormat DATE_FORMAT

To view the source code for org.jfree.data.time Day DATE_FORMAT.

Click Source Link

Document

A standard date formatter.

Usage

From source file:org.jfree.data.time.Day.java

/**
 * Parses the string argument as a day.//from   w w  w.j ava  2s  . c o m
 * <P>
 * This method is required to recognise YYYY-MM-DD as a valid format.
 * Anything else, for now, is a bonus.
 *
 * @param s  the date string to parse.
 *
 * @return <code>null</code> if the string does not contain any parseable
 *      string, the day otherwise.
 */
public static Day parseDay(String s) {
    try {
        return new Day(Day.DATE_FORMAT.parse(s));
    } catch (ParseException e1) {
        try {
            return new Day(Day.DATE_FORMAT_SHORT.parse(s));
        } catch (ParseException e2) {
            // ignore
        }
    }
    return null;
}