Giter Club home page Giter Club logo

Comments (5)

k15a avatar k15a commented on May 23, 2024 1

Maybe the strict version could parse the date and format it again and then check if both strings are the same?

from fecha.

ktunador avatar ktunador commented on May 23, 2024

Hi @taylorhakes, do you have any comment about this?

from fecha.

taylorhakes avatar taylorhakes commented on May 23, 2024

Yes, this is the intended behavior. moment.js behaves very similar (without the strict parameter). The library is meant to help with parsing valid date strings. It wasn't meant to parse invalid date strings. I will add something about this in the readme because it's not stated anywhere.

I would not be opposed to adding a strict version of the parser, if it doesn't add much bloat.

from fecha.

blujedis avatar blujedis commented on May 23, 2024

This is stale but, thought I'd bump. This lib claims to parse/format dates. Not parse/format NOT dates.

Considering numbers ensuring validity on a date is not a straight forward as one might think. In this case it likely is best left up to user/dev in his/her own lib. Build a helper lib for a timestamp or something and this will become more obvious as to why I say this. Just my .02.

from fecha.

taylorhakes avatar taylorhakes commented on May 23, 2024

I am going to close this issue. If someone would like to submit a PR to add a strict version (which doesn't add a lot of code), I would be happy to add it

from fecha.

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.