Skip to content

Toggle automatic date formatting #84

Open
@PerezPerezPerezPerez

Description

@PerezPerezPerezPerez

The JSON viewer automatically attempts to format date strings using new Date(). This is a convenient feature to have but I've stumbled across situations where it would be advantageous to turn off this feature. Can we add a parameter to the API that lets you toggle this feature on or off? By default it would be on.

I identified the code that performs the date string parsing.

Image

Here is what we could change the date string parsing code to, granted there was a formatTime parameter in the API:

    default: {
      // check to see if this is a date
      if (formatTime){
        input = Date.parse(input)
        if (input) {
          return formatResponse('string', input)
        }
      } else {
        return formatResponse(false, null)
      }
    }

I didn't do enough digging to see how we can add the new configurable parameter in the API for this. Can someone please help out with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions