Subject: [netmod] yang-types-03: new 'date' type

From: Andy Bierman <[email-masked]>
Date: Thu, 16 Jul 2009 09:35:35 -0700

Hi,

Since the revision-date is so important in YANG,
I think ietf-yang-types.yang should have a 'date'
typedef, not just 'date-and-time':

   typedef date {
     type string {
       pattern '\d{4}-\d{2}-\d{2}';
     }
     description
      'The date type is a profile of the ISO 8601
       standard for representation of dates using the
       Gregorian calendar. The format is most easily described
       using the following ABFN (see RFC 3339):

       date-fullyear   = 4DIGIT
       date-month      = 2DIGIT  ; 01-12
       date-mday       = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31

       full-date       = date-fullyear "-" date-month "-" date-mday

       The date type is consistent with the semantics defined
       in RFC 3339. The date type is compatible with the
       dateTime XML schema type with the following notable
       exception:

      // *** [ed: Note that the preceding paragraph, and
      // ***  2 bullets (a) and (b) have typos in the
      // ***  date-and-time version:
      // ***     s/data-and-time/date-and-time/ ]

       (a) The date type does not allow negative years.

      ';
     reference
      "RFC 3339: Date and Time on the Internet: Timestamps
       RFC 2579: Textual Conventions for SMIv2
       W3C REC-xmlschema-2-20041028: XML Schema Part 2: Datatypes
                 Second Edition";
   }

Andy