Coder Social home page Coder Social logo

"2013-02-07" recognition? about chrono HOT 4 CLOSED

xiaoli avatar xiaoli commented on July 18, 2024
"2013-02-07" recognition?

from chrono.

Comments (4)

wanasit avatar wanasit commented on July 18, 2024

Hello Xiaoli,

I patched chrono to recognize date with zero-padding (2013-02-07) as you suggested.

I have that IF statement for filtering some non-exsist date such as 2013-02-29.
[ var date = moment( '2013-02-29' , 'YYYY-MM-DD'); ] will return [March 1st] which is not correct answer in my opinion.

from chrono.

xiaoli avatar xiaoli commented on July 18, 2024

Hi berryboy, thanks for your quick fix. One more question, I also found chrono will return 12:00 if not found start/end hour, any reasons here?

from chrono.

wanasit avatar wanasit commented on July 18, 2024

As fas as I know, it's not recommend to mark the timestamp at the beginning of the day (midnight - 00:00). There are some case like - Day Time Saving on March 13, 2011 that skipped the time by one hour.

So, I think the safest timestamp to represent 'a day' is the middle of that day (or 12:00)

from chrono.

xiaoli avatar xiaoli commented on July 18, 2024

Yes, I think you are right at that point. However as chrono is a parser, so sometimes I don't know if chrono really extracted "12:00" from a given text or just return it by your above safest logic. Then the chrono may not be good to return "12:00" if the given text doesn't contain any time string, just my two cents.

from chrono.

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.