Giter VIP home page Giter VIP logo

jquery-parsejson-dateautoconversion's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

jquery-parsejson-dateautoconversion's Issues

Correct ISO 8601 date-time regular expression to include "Z"

Z is for UTC or Zulu time.
ISO 8601 standard should be checked for exact format that should be used.

Standard defines combined date and time as:

<date>T<time>

where date is most commonly represented by YYYYMMDD and time is commonly represented by HH:MM:SS. Additionally some other parts are appended to designate time as local or in relation to UTC.

<time>Z
<time>±hh:mm
<time>±hhmm
<time>±hh

All of the above should be covered by regular expression.

Decision whether UTC times (Zulu) should be converted to local times is part of further discussion and user needs.

Parsing .NET serialized dates when the date is lesser than 1970/01/01

The .NET JSON serializers convert the dates when the date is lesser than 1970/01/01 to a string like this (note the minus sign):

/Date(-123456789)/

Modifying the regular expressions below fixes that:

var dateNet = //Date((-?\d+)(?:-\d+)?)//i;
var replaceNet = /"\/Date((-?\d+)(?:-\d+)?)\/"/ig;

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.