ConnectingEurope / eInvoicing-EN16931

Validation artefacts for the European eInvoicing standard EN 16931
Other
141 stars 54 forks source link

Create checks, that the CII date format is verified #259

Closed phax closed 3 years ago

phax commented 3 years ago

Source: https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/56

Please check that the format attribute is only 102, 610 or 616

Check the 102 format like this:

A regular expression for this may look like this:

^[0-9][0-9][0-9][1-9](1[0-2]|0[1-9])(3[01]|2[0-9]1[0-9]|0[1-9])$
oriol commented 3 years ago

Applying regular expression (20\d{2})(\d{2})(\d{2}) to udt:DateTimeString[@format = '102']

phax commented 3 years ago

I don't like the fix 20 in front. Wouldn't it be simpler (and less error prone) to use \d{8} instead?

oriol commented 3 years ago

You are right.