Giter VIP home page Giter VIP logo

Comments (9)

FatulM avatar FatulM commented on June 7, 2024 1

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.

FatulM avatar FatulM commented on June 7, 2024 1

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.

FatulM avatar FatulM commented on June 7, 2024

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.

AliEasy avatar AliEasy commented on June 7, 2024

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.

FatulM avatar FatulM commented on June 7, 2024
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.

AliEasy avatar AliEasy commented on June 7, 2024

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.

FatulM avatar FatulM commented on June 7, 2024

please make an issue for that library and add the link here ...

from shamsi_date.

AliEasy avatar AliEasy commented on June 7, 2024

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.

FatulM avatar FatulM commented on June 7, 2024

It is not a bug !
it is the correct behavior !

from shamsi_date.

Related Issues (16)

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.