Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/views/TimeSlotEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ const handleSimpleAddAppts = (index) => {
showError(t('appointments', 'Invalid number of appointments'))
return
}
const starterTime = Math.floor((hd.startTime.getHours() *60 + hd.startTime.getMinutes() - gridMaker.SH_OFFSET * 60) / 5);
editor.menuIndex = -1
const dur = isNaN(props.data.dur) || props.data.dur < 5 ? 5 : props.data.dur
gridMaker.addAppt(0, dur, n, index, props.data.calColor)
gridMaker.addAppt(starterTime, dur, n, index, props.data.calColor)
hd.hasAppts = true
}

Expand Down Expand Up @@ -284,6 +285,13 @@ const gridApptsCopy = (index) => {
</template>
{{ t('appointments', 'Add Appointments') }}
</NcActionButton>
<NcActionInput
v-if="gridMode===gridMaker.MODE_SIMPLE"
:value.sync="hi.startTime"
type="time"
label="Starting from"
format="HH:mm">
</NcActionInput>
<NcActionButton
:disabled="!hi.hasAppts"
:closeAfterClick="true"
Expand Down
4 changes: 4 additions & 0 deletions src/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,8 @@ function _apptGridMaker() {
}
}

const startTime = new Date()
startTime.setHours(SH_OFFSET, 0, 0)
const header = []
for (let ts = startDate.getTime(), i = 0; i < n; i++) {
header[i] = {
Expand All @@ -730,6 +732,7 @@ function _apptGridMaker() {
w: w,
n: '8',// Initial value for "add" input must be string
hasAppts: false,
startTime: startTime
}
ts = startDate.setDate(startDate.getDate() + 1)
}
Expand All @@ -739,6 +742,7 @@ function _apptGridMaker() {
return {
MODE_SIMPLE: MODE_SIMPLE,
MODE_TEMPLATE: MODE_TEMPLATE,
SH_OFFSET: SH_OFFSET,
setup: setup,
addAppt: addAppt,
cloneColumns: cloneColumns,
Expand Down