You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 2, 2023. It is now read-only.
Re-introduce "format" keyword, with some differences
* Get rid of the "color" and "style" format attributes.
* Specify the different instance types which can be validated by attributes.
* Specify that if an instance is not of a type which the format attribute can
validate, the validation MUST succeed.
* "regex" is an ECMA 262 regular expression, remove "/perl5" since these
dialects are not compatible (perl5 supports lookbehinds, ECMA 262 doesn't).
* Remove paragraph allowing other format attributes to be specified.
<t>This property helps to refine the type of data, content type, or microformat an instance value must adhere to. A format
469
+
attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format
470
+
SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MUST validate that the
471
+
instance values conform to a format.</t>
472
+
473
+
<t>A format attribute only validates a defined set of primitive types. If the primitive type of the currently validated instance
474
+
is not a member of this set, the instance MUST be considered valid for this keyword. All format attributes defined below are
475
+
listed along with the primitive types they validate.</t>
476
+
477
+
<t>The following formats are predefined:
478
+
479
+
<liststyle="hanging">
480
+
<thangText="date-time"> (string) This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time.
481
+
This is the recommended form of date/timestamp.</t>
482
+
<thangText="date">(string) This SHOULD be a date in the format of YYYY-MM-DD. It is recommended that you use the
483
+
"date-time" format instead of "date" unless you need to transfer only the date part.</t>
484
+
<thangText="time">(string) This SHOULD be a time in the format of hh:mm:ss. It is recommended that you use the
485
+
"date-time" format instead of "time" unless you need to transfer only the time part.</t>
486
+
<thangText="utc-millisec">(number) This SHOULD be the difference, measured in milliseconds, between the
487
+
specified time and midnight, 00:00 of January 1, 1970 UTC.</t>
488
+
<thangText="regex">(string) This SHOULD be an ECMA 262 (ie, JavaScript) regular expression.</t>
489
+
<thangText="phone">(string) This SHOULD be a phone number (format MAY follow E.123).</t>
490
+
<thangText="uri">(string) This value SHOULD be a URI.</t>
491
+
<thangText="email">(string) This SHOULD be an email address.</t>
492
+
<thangText="ip-address">(string) This SHOULD be an ip version 4 address.</t>
493
+
<thangText="ipv6">(string) This SHOULD be an ip version 6 address.</t>
494
+
<thangText="host-name">(string) This SHOULD be a host-name.</t>
495
+
</list>
496
+
</t>
497
+
</section>
498
+
467
499
<sectiontitle="pattern"anchor="pattern">
468
500
<t>When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5</t>
0 commit comments