From 0359b97c800e923dc2d4d5489cab07f8a52f2afc Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Fri, 28 Apr 2006 21:12:31 +0000 Subject: [PATCH] moved DateField format question so it shows up in javadocs git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@398012 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/schema/DateField.java | 59 +++++++++++-------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/src/java/org/apache/solr/schema/DateField.java b/src/java/org/apache/solr/schema/DateField.java index f9a9f2b7724..23cea13df06 100644 --- a/src/java/org/apache/solr/schema/DateField.java +++ b/src/java/org/apache/solr/schema/DateField.java @@ -26,41 +26,50 @@ import org.apache.solr.search.function.OrdFieldSource; import java.util.Map; import java.io.IOException; -/*** -Date Format for the XML, incoming and outgoing: - -A date field shall be of the form 1995-12-31T23:59:59Z -The trailing "Z" designates UTC time and is mandatory. -Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z -All other parts are mandatory. - -This format was derived to be standards compliant (ISO 8601) and is a more -restricted form of the canonical representation of dateTime from XML schema part 2. -http://www.w3.org/TR/xmlschema-2/#dateTime - -"In 1970 the Coordinated Universal Time system was devised by an international -advisory group of technical experts within the International Telecommunication -Union (ITU). The ITU felt it was best to designate a single abbreviation for -use in all languages in order to minimize confusion. Since unanimous agreement -could not be achieved on using either the English word order, CUT, or the -French word order, TUC, the acronym UTC was chosen as a compromise." -***/ - -// The XML (external) date format will sort correctly, except if -// fractions of seconds are present (because '.' is lower than 'Z'). -// The easiest fix is to simply remove the 'Z' for the internal -// format. - // TODO: make a FlexibleDateField that can accept dates in multiple // formats, better for human entered dates. // TODO: make a DayField that only stores the day? + /** + * FieldType that can represent any Date/Time with millisecond precisison. + *

+ * Date Format for the XML, incoming and outgoing: + *

+ *
+ * A date field shall be of the form 1995-12-31T23:59:59Z + * The trailing "Z" designates UTC time and is mandatory. + * Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z + * All other parts are mandatory. + *
+ *

+ * This format was derived to be standards compliant (ISO 8601) and is a more + * restricted form of the canonical representation of dateTime from XML + * schema part 2. + * http://www.w3.org/TR/xmlschema-2/#dateTime + *

+ *
+ * "In 1970 the Coordinated Universal Time system was devised by an + * international advisory group of technical experts within the International + * Telecommunication Union (ITU). The ITU felt it was best to designate a + * single abbreviation for use in all languages in order to minimize + * confusion. Since unanimous agreement could not be achieved on using + * either the English word order, CUT, or the French word order, TUC, the + * acronym UTC was chosen as a compromise." + *
+ * * @author yonik * @version $Id$ + * @see XML schema part 2 */ public class DateField extends FieldType { + + // The XML (external) date format will sort correctly, except if + // fractions of seconds are present (because '.' is lower than 'Z'). + // The easiest fix is to simply remove the 'Z' for the internal + // format. + protected void init(IndexSchema schema, Map args) { }