Comments (9)
Oh,
I have an idea
:D
Maybe it is a problem of the date picker library you were using !
Since shamsi_date is stateless, but the date picker may be related to the date you are using it ...
from shamsi_date.
So I will close this issue,
Since it is not related to shamsi_date.
I also opened an issue on the calendar ui library which you where using ...
from shamsi_date.
Hi,
I think the reason is when you add 3 months to 1400/05/31 you will get
1400/08/31 and in shamsi calendar only the first 6 months have 31 days
but the next months have less days (either 30 or 29) so this is an invalid date.
for your next statement about changing date,
can you provide complete example ?
from shamsi_date.
Nothing new... Just instead of 1400/05/31
I used 1400/05/20
:
Jalali date;
var initDate = '1400/05/20';
var splitDate = initDate.split("/");
var date1 = Jalali(int.parse(splitDate[0]), int.parse(splitDate[1]), int.parse(splitDate[2]));
date = date1.addMonths(3); -------------> The line that exception happens
from shamsi_date.
import 'package:shamsi_date/shamsi_date.dart';
void main() {
final d = Jalali(1400, 05, 20);
print(d);
print(d.addMonths(3));
}
this results in:
Jalali(1400, 5, 20)
Jalali(1400, 8, 20)
what version of shamsi_date are you using ?
from shamsi_date.
Yes this is working fine today
The exception was only happening on 1400/05/31
as I said:
The point is this is ONLY happening today at 1400/05/31 (8/2/2021) and was working fine the other days
on 1400/05/31, no matter what date I tried addMonths
on.... the result was the mentioned exception anyway
Im using shamsi_date: ^0.15.0
from shamsi_date.
please make an issue for that library and add the link here ...
from shamsi_date.
Hmm thanks I will sure do that.
And about this:
I think the reason is when you add 3 months to 1400/05/31 you will get
1400/08/31 and in shamsi calendar only the first 6 months have 31 days
but the next months have less days (either 30 or 29) so this is an invalid date.
is this related to the date picker too?
Or is it a bug at all?! if not how should I handle it
from shamsi_date.
It is not a bug !
it is the correct behavior !
from shamsi_date.
Related Issues (16)
- 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
- 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
- addMonth() make invalid date in some cases 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.