tejainece/date_format

reamde examples are incorrect

Closed this issue · 1 comments

All of the examples on you readme page are incorrect as you have forgotten to quote the value:

print(formatDate(DateTime(1989, 02, 21), [yyyy, '-', mm, '-', dd]));

should read

print(formatDate(DateTime(1989, 02, 21), ['yyyy', '-', 'mm', '-', 'dd]'));

yyyy, mm and dd are constant variables defined in the package.

https://pub.dev/documentation/date_format/latest/date_format/yyyy-constant.html
https://pub.dev/documentation/date_format/latest/date_format/mm-constant.html
https://pub.dev/documentation/date_format/latest/date_format/dd-constant.html

This is deliberately implemented this way, so that date format strings can be typed, avoid typos and can be code completed.