Giter Club home page Giter Club logo

Comments (4)

therapon avatar therapon commented on August 13, 2024

Thanks for the example and stack trace.

It seems that there are a couple of issues with timestamp within ion-js but also with interoperating with othen Ion Libs (e.g., Java).

I'll be looking into building testing infrastructure to round trip Ion and ensure that ion-js can commute with results from and to other Ion Libs.

from ion-js.

kadishmal avatar kadishmal commented on August 13, 2024

I suppose the accepted hours should be between 0 and 23. Don't you think so? If so, I suppose this is just a one line fix + tests. If so, I can push a fix.

Regarding interoperability with other languages, aren't you following the spec? Because spec is spec in any language. https://amzn.github.io/ion-docs/spec.html suggests that 00 is an acceptable value for an hour.

from ion-js.

therapon avatar therapon commented on August 13, 2024

PRs are always welcome :)

You are correct about the Spec and this specific issue. There are other aspects of the spec that allow for implementations to make certain decisions. My previous comment was more in regards to getting all such cases dealt with in a systematic way. Sorry for not expanding a little more on that topic.

from ion-js.

kadishmal avatar kadishmal commented on August 13, 2024

The following are from the above-mentioned spec. Some of them fail with the current code.

2007-02-23T12:14Z                // Seconds are optional, but local offset is not
2007-02-23T12:14:33.079-08:00    // A timestamp with millisecond precision and PST local time
2007-02-23T20:14:33.079Z         // The same instant in UTC ("zero" or "zulu")
2007-02-23T20:14:33.079+00:00    // The same instant, with explicit local offset
2007-02-23T20:14:33.079-00:00    // The same instant, with unknown local offset

2007-01-01T00:00-00:00           // Happy New Year in UTC, unknown local offset
2007-01-01                       // The same instant, with days precision, unknown local offset
2007-01-01T                      //    The same value, different syntax.
2007-01T                         // The same instant, with months precision, unknown local offset
2007T                            // The same instant, with years precision, unknown local offset

2007-02-23                       // A day, unknown local offset 
2007-02-23T00:00Z                // The same instant, but more precise and in UTC
2007-02-23T00:00+00:00           // An equivalent format for the same value
2007-02-23T00:00:00-00:00        // The same instant, with seconds precision

2007                             // Not a timestamp, but an int
2007-01                          // ERROR: Must end with 'T' if not whole-day precision, this results as an invalid-numeric-stopper error
2007-02-23T20:14:33.Z            // ERROR: Must have at least one digit precision after decimal point.

from ion-js.

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.