Skip to content

Conversation

@codomposer
Copy link
Contributor

@codomposer codomposer commented Oct 29, 2025

Improve Documentation: Add Comprehensive Import Guidance

Description

Closes #5753
Closes #3135
Closes #4360

Problem
Users reported confusion when working with documentation examples, particularly:

  • Not knowing where range(), getYear(), and getMonth() functions come from
  • Missing import statements in example code
  • Having to search through the git repository to find the correct imports

Changes

1. Updated README.md

Added a new "Working with Examples" section that provides:

  • Common date-fns imports needed for date manipulation (getYear, getMonth, addDays, subDays, etc.)
  • Two options for the range() utility function (lodash or custom implementation)
  • TypeScript type imports (ReactDatePickerCustomHeaderProps)
  • Link to comprehensive imports guide

2. Created Comprehensive Imports Guide (docs/imports-guide.md)

A complete reference document including:

  • Basic Setup: Required imports for every implementation
  • Date Manipulation: Common date-fns functions with usage examples
  • Utility Functions: range() function implementation options
  • TypeScript Types: Available type exports and their usage
  • Localization: How to import and register locales
  • Custom Components: CalendarContainer examples
  • Complete Example: Full working code with all necessary imports
  • Quick Reference Table: At-a-glance import guide

Screenshots

N/A

To reviewers

N/A

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.27%. Comparing base (bc4df59) to head (7c91ebf).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5980   +/-   ##
=======================================
  Coverage   97.27%   97.27%           
=======================================
  Files          30       30           
  Lines        3481     3481           
  Branches     1478     1475    -3     
=======================================
  Hits         3386     3386           
  Misses         95       95           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martijnrusschen martijnrusschen merged commit a1618ce into Hacker0x01:main Oct 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants