Code Monkey home page Code Monkey logo

Comments (7)

magicmatatjahu avatar magicmatatjahu commented on May 26, 2024 1

Exactly as @c-pius wrote. For example 15:59:60-08:00 will mean 15:59:60 time, 8 hours behind UTC.

Additionally, following with the RFC 3339 there should be partial-time (time should use this format, but I don't know if this is a good idea -> ref: OAI/OpenAPI-Specification#845) format without offset and full-time with offset.

from openapi-sampler.

adamaltman avatar adamaltman commented on May 26, 2024

What about time zone properties? For example +00:00?

from openapi-sampler.

c-pius avatar c-pius commented on May 26, 2024

openapi-sampler uses Z notation for time offset in date-time. so I guess RFC 3339 full-time with Z time offset would make sense?

let res = toRFCDateTime(new Date('2019-08-24T14:15:22.123Z'), omitTime, false);

export function toRFCDateTime(date, omitTime, milliseconds) {

from openapi-sampler.

adamaltman avatar adamaltman commented on May 26, 2024

I think it would be better to use a format of "partial-time" or "full-time" for clarity and alignment with the RFC 3339.

from openapi-sampler.

c-pius avatar c-pius commented on May 26, 2024

@magicmatatjahu you are right, even appears like the discussions from your reference lean towards time format using partial-time from the RFC?

I don't really have an opinion whether time should use partial-time or full-time. Also not sure if it is a good idea to provide different formats "partial-time" and "full-time".

from openapi-sampler.

magicmatatjahu avatar magicmatatjahu commented on May 26, 2024

@c-pius "partial-time" and "full-time" should be provide for this same cases like date and date-time, I mean you should have possibility to define time without timezone and with timezone. If there will be only full-time for example, then specifying time with a zero offset (if an offset is not needed) may be confusing

I can create PR for that, but after read the issue, which I mentioned it might be better to wait for the official support for the time format or for the format registry.

from openapi-sampler.

magicmatatjahu avatar magicmatatjahu commented on May 26, 2024

As I see the time format is added in #122 PR, so I close the issue, thanks!

from openapi-sampler.

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.