Coder Social home page Coder Social logo

Comments (2)

DavidUnderdown avatar DavidUnderdown commented on June 14, 2024

While half hour timezones do exist, so far as I'm aware neither +00:30 or -00:30 is used (or anything else between +01:00 and -01:00 exclusive) so I'm not sure it is actually erroneous to define in that way. There's possibly a good reason for why the second is written that way too, @adamretter do you have any idea?

from csv-schema.

mightyCelu avatar mightyCelu commented on June 14, 2024

That is true. However, I still think the inconsistency is worth addressing. Which timezones currently exist can change, and it is also conceivable to have data at a time offset that does not correspond to a commonly accepted timezone. This is something the currently specified regex reflects (e.g. +01:42), just not for offsets beginning with 00. Moreover, the offsets +00:00 & -00:00, are also not valid with the current regex. While they are equivalent to Z, I feel it would be arbitrary to forbid these values. In particular, since the referenced data type specification (3.7.2.3) permits these values as well.

All in all I would suggest the following regex:

((\+\|-)((0[0-9]\|1[0-3]):([0-5][0-9])\|14:00)\|Z)

which includes the following changes:

  • allows for offsets 00:00 - 00:59
  • simplifies the subgroup for the minutes
  • reduces the maximum magnitude of the allowed offset to at most fourteen hours (in acordance with the XSD specification)

from csv-schema.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.