wh minor fix
This commit is contained in:
parent
4f6b69b89b
commit
d5750a495d
2 changed files with 3 additions and 8 deletions
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue