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

Issue with Day Addition/Subtraction in pl_PL Local #254

Open Qionar opened 12 months ago

Qionar commented 12 months ago

Using the 'pl' locale, in some cases 23 hours are calculated instead of a full day when adding/subtracting using these methods.

This can be easily reproduced as follows:

   await Jiffy.setLocale('pl');

    print(
      Jiffy.parse('2023-10-29T00:00:00.000')
          .add(days: 1)
          .dateTime
          .toIso8601String(),
    );

   // output: 2023-10-29T23:00:00.000

    print(
      Jiffy.parse('2023-11-06T00:00:00.000')
          .subtract(weeks: 2)
          .dateTime
          .toIso8601String(),
    );

   // output: 2023-10-23T01:00:00.000

I expect to get the date 2023-10-30T00:00:00.000 instead of 2023-10-29T23:00:00.000 for addition and 2023-10-23T00:00:00.000 instead of 2023-10-23T01:00:00.00.000 for subtraction.