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

Can not format date using "DO" from version 5.0 #224

Closed wilpar closed 1 year ago

wilpar commented 1 year ago

Describe the bug

In versions up to 5.0, I was able to use the following:

 String todayString = Jiffy(today).format("do");

when using the new constructor, I get an error. Tried 2 ways:

String todayString = Jiffy.parseFromDateTime(today).format('do');
String todayString = Jiffy.parseFromDateTime(today).do;

First complains about too many positional arguments. Second does not recognize the do format.

How to reproduce the bug

Try it ;)

What is the expected behaviour

I expect it to give me 5th, 12th, 1st, etc.

I would like to get the date with the DO extension. That's the whole reason I use the Jiffy package.

wilpar commented 1 year ago

Edit: It seems you've added a named parameter of "pattern", but haven't updated the examples.

String todayString = Jiffy.parseFromDateTime(today).format(pattern: 'do');