jama5262 / jiffy

Jiffy is a Flutter (Android, IOS and Web) date time package for parsing, manipulating, querying and formatting dates
https://pub.dev/packages/jiffy
MIT License
588 stars 126 forks source link

DayOfYear in bengali throws FormatException #257

Open DaVaMa1 opened 11 months ago

DaVaMa1 commented 11 months ago

Describe the bug

In the bengali (bn) locale, calling .dayOfYear will throw.

Unhandled exception:
FormatException: Invalid radix-10 number (at character 1)
৩২৯

In Sentry the tokens are represented as ٣٣١. Not sure where the difference comes from. edit: these are just numbers for the actual dayOfYear value.

How to reproduce the bug

edit: I thought it was only certain days, but it is any day.

    final date = Jiffy.parseFromDateTime(DateTime(2023, 11, 27));
    print(date.dayOfYear);

What is the expected behavior

The day of the year in the respective locale is returned

Additional information

I'll reach out to my own localization team for some more info as I don't speak any Bengali. The bug has little prio for me atm as it won't be relevant after today to fix for almost a year.

I'll dig into the code a little bit and the translations to see if I can fix it myself, but that might take a bit.

DaVaMa1 commented 11 months ago

Might be related to 103.

After some experimenting I think it also throws in other non roman locales