Hi,
I’ve set the date and time to the selectedDate
prop in react. The currentTimeIndicator
is displaying based on my local PC time. While the selectedDate
value navigates to the correct date and time, the currentTimeIndicator
does not show the time from the selectedDate
. Is there any option to display the currentTimeIndicator
based on the time of the selectedDate
?
Hello @Amanur_Rahman
The currentTimeIndicator
is displayed based on the browser’s local timezone, and it isn’t influenced by the selectedDate
option’s value.
If you would like to change the currentTimeIndicator
timezone, then it can be modified with the help of the displayTimezone option, which can be used to define the timezone in which the data is displayed. In order to the displayTimezone
option to work you’ll have to use one of the supported timezone libraries. We are supporting momnet.js
and luxon
libraries at the moment.
So far I haven’t come across the dayjs library before, but as I see based on this article, it’s API is really close to moment.js. So there might be a chance that the dayjs might be working with the moment.js plugin.
Here is a quick snippet:
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import { momentTimezone } from '@mobiscroll/react';
dayjs.extend(utc)
dayjs.extend(timezone)
momentTimezone.moment = dayjs;