FatulM / shamsi_date

A Flutter and Dart package for using Jalali (Shamsi, Solar, Persian, Jalaali, شمسی or خورشیدی) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi or میلادی) date and times.
https://pub.dev/packages/shamsi_date
BSD 3-Clause "New" or "Revised" License
78 stars 10 forks source link

Month checking Issue #15

Closed Mohammad-Hosein88 closed 1 year ago

Mohammad-Hosein88 commented 1 year ago

There was an error in Jalali formatter file which was an if statement checking if received month is treater than ml or not(ml being month length). months are 31 or 30 but it just accepted lower than this number meaning greatest month length was 30 so I got an error and check you code and found it out. I committed my change so it would be great if you accepted it ASAP because Im using it inside my project. Thanks in advance :)

FatulM commented 1 year ago

Hi, I've read your issues and checked your pull requests. First of all you have created two separate pull requests, please close one of them. Second, I don't get your point and I think the code is correct ... Can you please provide an example in case I have misunderstood you ?

Mohammad-Hosein88 commented 1 year ago

Hey there For example if the month is Tir (which has 31 days) and you try to set its day 31, it would give an error saying Jalali day out of range, also if you set the day 30 in Azar (which has 30 days) it would also give the same error

FatulM commented 1 year ago

In test file: https://github.com/FatulM/shamsi_date/blob/master/test/shamsi_date_test.dart There are examples for last day of a month: like https://github.com/FatulM/shamsi_date/blob/master/test/shamsi_date_test.dart#L347 which is

Jalali(1393, 1, 31);

contradictory to your issue.

please provide a complete reproducible example with error messages, outputs and etc.