Giter VIP home page Giter VIP logo

Comments (5)

FatulM avatar FatulM commented on June 14, 2024 1

Hi,
I have fixed the issue in version 0.9.0.

Now ALL created date instances are valid. When you are creating a new date instance if think it can be invalid or become out of computable range you should surround code block with try-catch and capture DateException.

Is your problem solved ?
@NaarGes

from shamsi_date.

FatulM avatar FatulM commented on June 14, 2024 1

I've handled this case manually

Now in the 0.9.0 version you can soround your code block with try-catch instead of handling manually. Sorry for being so late in solving this issue, I didn't have time ...

I'll close this issue. If your problem is not solved feel free to reopen this issue or creating another one ...

@NaarGes

from shamsi_date.

FatulM avatar FatulM commented on June 14, 2024

Hi,
This is a known issue, but I don't know how to solve it!

At present my project is to make some changes on the next release to enforce dates being valid. Then if you want to create an invalid date by using constructors or operators like addMonth, it will throw exception. This way all of the dates are valid and it's the user's responsibility to catch exceptions or avoid it in the first place. I think this is the way that libraries like joda-time in Java handle this issue.

What is your opinion ?
@NaarGes

from shamsi_date.

NaarGes avatar NaarGes commented on June 14, 2024

yes thank you, prevention of creating invalid dates is a good idea and it can be done by throwing an error.

from shamsi_date.

NaarGes avatar NaarGes commented on June 14, 2024

I've handled this case manually

from shamsi_date.

Related Issues (19)

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.