wh minor fix

This commit is contained in:
Maxim 2022-08-24 13:37:33 +03:00
parent 4f6b69b89b
commit d5750a495d
2 changed files with 3 additions and 8 deletions

View file

@ -3,7 +3,8 @@ import dayjs from 'dayjs';
export const getWorkingMoments = (startMoment, endMoment, workingHours, timezone) => {
const weekdays = dayjs.weekdays();
const momentToStartIteration = startMoment.tz(timezone);
const momentToStartIteration = dayjs().tz(timezone).utcOffset() === 0 ? startMoment : startMoment.tz(timezone);
const dayOfWeekToStartIteration = momentToStartIteration.format('dddd');
const weekDaysToIterateChunk = [

View file

@ -24,13 +24,7 @@ interface WorkingHoursProps {
const cx = cn.bind(styles);
const WorkingHours: FC<WorkingHoursProps> = (props) => {
const {
timezone,
workingHours,
startMoment = dayjs().utc().startOf('week'),
duration = 14 * 24 * 60 * 60,
className,
} = props;
const { timezone, workingHours, startMoment, duration, className } = props;
const endMoment = startMoment.add(duration, 'seconds');