arqex / react-datetime

A lightweight but complete datetime picker react component.
1.99k stars 873 forks source link

Added onViewDateChange callback for when the viewed date changes #790

Open JakeThurman opened 3 years ago

JakeThurman commented 3 years ago

These changes are equivalent to those in PR #403, but reapplied to the v3 codebase. That pull request was closed for being stale.

Description

I added a callback that is triggered whenever the viewDate state value changes.

Motivation and Context

There is currently no way to respond to the visible period changing, for example if you need to data from the server in order to render the component.

In our application, we color-code the days in the days-of-the-month view. To do this we need to always be aware of what days are visible.

Checklist

Questions

I wasn't sure what branch this should be targeting. Please let me know if I should change it to v3

JakeThurman commented 2 years ago

@arqex Is there someone I can reach out to get this reviewed?