Devextreme-reactive: How can I get the current date period?

Created on 30 Sep 2020  路  2Comments  路  Source: DevExpress/devextreme-reactive

  • [x] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [ ] React Grid
  • [ ] React Chart
  • [x] React Scheduler

Description

Hi,
I'm just trying to get the current weekly date period that is active in the scheduler. I can't for the life of me figure this out. Could someone please point me in the right direction?

Scheduler question

All 2 comments

Hi @baj84,

You can get the current time period using our Plugin System. In the following example, I created an additional plugin (ViewBoundaries) that gets two values - startViewDate and endViewDate - from the scheduler component and passes these values to the parent component on callbacks.

You can find more information on the plugin system in our knowledge base.

Thanks. I found a much easier way, for anyone else who stumbles along this, this was my solution:
const handleDateChange = date => { console.log(date)};
<ViewState onCurrentDateChange={date => handleDateChange(date)} />

Was this page helpful?
0 / 5 - 0 ratings