List of usage examples for org.jfree.chart.date SerialDate monthCodeToQuarter
public static int monthCodeToQuarter(final int code)
From source file:org.jfree.data.time.Quarter.java
/** * Creates a new <code>Quarter</code> instance, using the specified * zone and locale./* w w w . j a va 2s.c o m*/ * * @param time the current time. * @param zone the time zone. * @param locale the locale. * * @since 1.0.12 */ public Quarter(Date time, TimeZone zone, Locale locale) { Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); int month = calendar.get(Calendar.MONTH) + 1; this.quarter = (byte) SerialDate.monthCodeToQuarter(month); this.year = (short) calendar.get(Calendar.YEAR); peg(calendar); }