Skip to content

Commit

Permalink
fix(nc-gui): issue with generating 45 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkPhoenix2704 committed Feb 28, 2024
1 parent a5b36bd commit b86848b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const calculateNewRow = (event: MouseEvent) => {
// We calculate the hour based on the percentage of the mouse position in the scroll container
// It can be between 0 and 23 (inclusive)
const hour = Math.max(Math.floor(percentY * 23), 0)
const minutes = Math.max(0, Math.min(59, Math.floor(((percentY * 22 - hour) * 60) / 15) * 15))
const minutes = Math.max(0, Math.min(59, Math.floor(((percentY * 22 - hour) * 60) / 15 + 0.5) * 15))
// We calculate the new startDate by adding the hour to the start of the selected date
const newStartDate = dayjs(selectedDate.value).startOf('day').add(hour, 'hour').add(minutes, 'minute')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ const calculateNewRow = (
const day = Math.max(0, Math.min(6, Math.floor(percentX * 7)))
const hour = Math.max(0, Math.min(23, Math.floor(percentY * 24)))
const minutes = Math.max(0, Math.min(59, Math.floor(((percentY * 22 - hour) * 60) / 15) * 15))
const minutes = Math.max(0, Math.min(59, Math.floor(((percentY * 22 - hour) * 60) / 15 + 0.5) * 15))
const newStartDate = dayjs(selectedDateRange.value.start).add(day, 'day').add(hour, 'hour').add(minutes, 'minute')
if (!newStartDate) return { newRow: null, updatedProperty: [] }
Expand Down
1 change: 0 additions & 1 deletion packages/nc-gui/composables/useViewColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ const [useProvideViewColumns, useViewColumns] = useInjectionState(
}

const saveOrUpdate = async (field: any, index: number, disableDataReload: boolean = false) => {
console.log('saveOrUpdate', field, index, disableDataReload)
if (isLocalMode.value && fields.value) {
fields.value[index] = field
meta.value!.columns = meta.value!.columns?.map((column: ColumnType) => {
Expand Down

1 comment on commit b86848b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR changes have been deployed. Please run the following command to verify:

docker run -d -p 8888:8080 nocodb/nocodb-timely:0.204.1-pr-7731-20240228-0653

Please sign in to comment.