001/* 002 * Licensed under the Apache License, Version 2.0 (the "License"); 003 * you may not use this file except in compliance with the License. 004 * You may obtain a copy of the License at 005 * 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * 008 * Unless required by applicable law or agreed to in writing, software 009 * distributed under the License is distributed on an "AS IS" BASIS, 010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 011 * See the License for the specific language governing permissions and 012 * limitations under the License. 013 */ 014package org.gbif.common.parsers.date; 015 016/** 017 * Date component orderings are given to the parser to help to select the right set of DateTimeFormatters 018 */ 019public enum DateComponentOrdering { 020 /** Year, month, day, time, zone */ 021 YMDTZ, 022 /** Year, month, day, time */ 023 YMDT, 024 /** Year, month, day */ 025 YMD, 026 /** Day, month, year, time */ 027 DMYT, 028 /** Day, month, year */ 029 DMY, 030 /** Month, day, year, time */ 031 MDYT, 032 /** Month, day, year */ 033 MDY, 034 /** Year, month */ 035 YM, 036 /** Year, week number */ 037 YW, 038 /** Year, day of year */ 039 YD, 040 /** Year */ 041 Y, 042 /** Chinese, Japanese, Korean: Year, month, day. */ 043 HAN, 044 /** The default set of unambiguous, year-month-day-like orderings. */ 045 ISO_ETC; 046 047 /** ISO formats */ 048 public static DateComponentOrdering[] ISO_FORMATS = new DateComponentOrdering[]{YMDTZ, YMDT, YMD, YM, YW, YD, Y}; 049 050 /** Day-Month-Year formats */ 051 public static DateComponentOrdering[] DMY_FORMATS = new DateComponentOrdering[]{DMYT, DMY}; 052 053 /** Month-Day-Year formats, primarily used in the USA */ 054 public static DateComponentOrdering[] MDY_FORMATS = new DateComponentOrdering[]{MDYT, MDY}; 055}