Skip to content

Commit

Permalink
clean(ZMS-3253): remove console log
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fink authored and Thomas Fink committed Feb 4, 2025
1 parent 29049a6 commit 97e70f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 2 additions & 5 deletions zmsadmin/js/page/availabilityDay/form/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,12 @@ class AvailabilityDatePicker extends Component {
// Block maintenance window (22:00-01:00)
return !(hour >= 22 || hour < 1 || (hour === 22 && minutes > 0));
}

// For today, check both maintenance window and use fixed 0-minute buffer

const currentTime = moment();
const timeToCheck = moment(time);
const minutesDiff = timeToCheck.diff(currentTime, 'minutes');

return minutesDiff >= 0; // Fixed 30-minute buffer
return minutesDiff >= 0;
};

/*
Expand All @@ -316,8 +315,6 @@ class AvailabilityDatePicker extends Component {
};
*/

console.log('slotTimeInMinutes:', this.state.availability.slotTimeInMinutes); // logs 90

return (
<div className="grid">
<div className="grid__item one-half">
Expand Down
4 changes: 0 additions & 4 deletions zmsadmin/js/page/availabilityDay/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const getStateFromProps = (props, existingState = {}) => {
conflicts: props.conflicts,
today: props.today,
busyslots: props.busyslots,
// Preserve SaveBar state
saveType: existingState.saveType || 'save',
lastSave: existingState.lastSave,
saveSuccess: existingState.saveSuccess
Expand Down Expand Up @@ -116,7 +115,6 @@ export const getNewAvailability = (timestamp, tempId, scope, existingAvailabilit

const slotTimeInMinutes = scope.provider.data['slotTimeInMinutes'] || 20

// Use one slot duration for initial availability
let endTime = moment(startTime).add(slotTimeInMinutes, 'minutes')

if (endTime.isAfter(dayEndTime)) {
Expand All @@ -140,8 +138,6 @@ export const getNewAvailability = (timestamp, tempId, scope, existingAvailabilit
} else {
const lastAvail = todayAvailabilities[todayAvailabilities.length - 1]
startTime = moment(lastAvail.endTime, 'HH:mm:ss')
// Round up to next hour
//startTime = startTime.add(1, 'hour').startOf('hour')

if (now.format('YYYY-MM-DD') === currentTime.format('YYYY-MM-DD') && startTime.isBefore(currentTime)) {
startTime = moment(currentTime).add(1, 'hour').startOf('hour')
Expand Down

0 comments on commit 97e70f1

Please sign in to comment.