Comments (5)
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.
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 ...
from shamsi_date.
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.
yes thank you, prevention of creating invalid dates is a good idea and it can be done by throwing an error.
from shamsi_date.
I've handled this case manually
from shamsi_date.
Related Issues (19)
- Make dates comparable HOT 2
- Jalali day is out of valid range. HOT 7
- The method distanceTo isn't defined for type Jalali HOT 6
- Jalali day is out of valid range HOT 9
- bug in addMonths method HOT 5
- Month checking Issue HOT 3
- is it possible get holidays HOT 1
- .toIso8601String() extension support HOT 1
- copy(), withDay(), ... not exist HOT 1
- month range error HOT 5
- when i add shamsi_date package to dependencies and run pub get i get this error Package not available (authorization failed)
- error when i add the package to dependencies
- The problem of 2124/03/20 HOT 5
- Diff 2 dates HOT 1
- How to access time data? HOT 2
- Why screenshots of calendar is not included in this package? HOT 3
- Jalali day is out of range HOT 2
- Convert To Jalali directly from '2021-02-10T17:42:01' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shamsi_date.