flowbite-react icon indicating copy to clipboard operation
flowbite-react copied to clipboard

fix(datepicker): datePicker now supports formatting of date

Open dhavalveera opened this issue 3 months ago • 10 comments

🛠️ Enhancement: Added Date Formatting Support to DatePicker

This PR introduces date formatting support to the DatePicker component by leveraging the date-fns package. Users can now customize date formats such as dd-MMM-yyyy or dd MMM yyyy according to their preferences.

outputs/examples:

dd-MMM-yyyy // output => 11-Mar-2024

image

dd MMM yyyy // output => 11 Mar 2024

image

dd-MM-yyyyy // output => 11-03-2024

image

Summary by CodeRabbit

  • New Features

    • Introduced a Datepicker component with configurable date formats and localization support.
    • Added documentation for date format and localization settings in the Datepicker component.
  • Improvements

    • Enhanced Datepicker tests to support various date formats.
    • Updated Datepicker to use consistent date formatting and locale settings through date-fns.
  • Dependencies

    • Added date-fns version 3.6.0 to support date formatting and localization.

dhavalveera avatar Mar 25 '24 09:03 dhavalveera