mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
Merge branch 'main' of bitbucket.org:studiotem/jandl-taskmanager-app
This commit is contained in:
commit
ebffbd29c3
4 files changed
+28
-19
No files matched your search
@@ -116,7 +116,7 @@ export default {
|
||||
events.push({
|
||||
title: "Non working hours",
|
||||
start: dayStart,
|
||||
end: this._setMinutesToDate(employee.work_start, date),
|
||||
end: this._setMinutesToDate(employee.work_start * 60, date),
|
||||
type: 'non-working-hours',
|
||||
split: i + 1,
|
||||
draggable: false
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
|
||||
events.push({
|
||||
title: "Non working hours",
|
||||
start: this._setMinutesToDate(employee.work_end, date),
|
||||
start: this._setMinutesToDate(employee.work_end * 60, date),
|
||||
end: dayEnd,
|
||||
type: 'non-working-hours',
|
||||
split: i + 1,
|
||||
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
const schedulesCapacityBySplit = {}
|
||||
|
||||
const now = moment()
|
||||
const dailyCapacityMinutes = this.user.work_end - this.user.work_start
|
||||
const dailyCapacityMinutes = (this.user.work_end - this.user.work_start) * 60
|
||||
|
||||
this.timelineData.tasks.forEach(task => {
|
||||
if (task.type == 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished)
|
||||
@@ -85,8 +85,8 @@ export default {
|
||||
} else if (i == 1) {
|
||||
// Today
|
||||
const elapsedMinutes = now.diff(now.clone().startOf('day'), 'minutes')
|
||||
const workStart = this.user.work_start > elapsedMinutes ? this.user.workStart : elapsedMinutes
|
||||
const todayCapacityMinutes = this.user.work_end - workStart
|
||||
const workStart = this.user.work_start * 60 > elapsedMinutes ? this.user.workStart : elapsedMinutes
|
||||
const todayCapacityMinutes = this.user.work_end * 60 - workStart
|
||||
unscheduledTime = todayCapacityMinutes - schedulesCapacityBySplit[i + 1] < 0 ? 0 : todayCapacityMinutes - schedulesCapacityBySplit[i + 1]
|
||||
} else {
|
||||
// Future
|
||||
@@ -172,7 +172,7 @@ export default {
|
||||
|
||||
try {
|
||||
const { subtasks, blockers } = await this.$axios.get_auth(`v1/subtasks?${queryParameters}`)
|
||||
this.config.scrollHour = (this.filter?.employee.work_start / 60) - 1
|
||||
this.config.scrollHour = (this.filter?.employee.work_start) - 1
|
||||
this.config.date = this.filter.start
|
||||
this.subtasks = [...subtasks, ...blockers]
|
||||
} catch (error) {
|
||||
|
||||
@@ -58,20 +58,20 @@ export default {
|
||||
_generateNonWorking() {
|
||||
const nonWorkingHours = []
|
||||
const date = new Date(this.filter.start)
|
||||
let earliestStartMinutes = null
|
||||
let earliestHour = null
|
||||
this.calendarConfig.date = date
|
||||
|
||||
const { start: dayStart, end: dayEnd } = this._getDayStartEnd()
|
||||
|
||||
this.filter.team.employees.forEach((employee, index) => {
|
||||
if (!earliestStartMinutes || (employee.work_start) < earliestStartMinutes)
|
||||
earliestStartMinutes = employee.work_start
|
||||
if (!earliestHour || (employee.work_start) < earliestHour)
|
||||
earliestHour = employee.work_start
|
||||
|
||||
|
||||
nonWorkingHours.push({
|
||||
title: "Non working hours",
|
||||
start: dayStart,
|
||||
end: this._setMinutesToDate(employee.work_start),
|
||||
end: this._setMinutesToDate(employee.work_start * 60),
|
||||
split: index + 1,
|
||||
type: 'non-working-hours',
|
||||
draggable: false
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
|
||||
nonWorkingHours.push({
|
||||
title: "Non working hours",
|
||||
start: this._setMinutesToDate(employee.work_end),
|
||||
start: this._setMinutesToDate(employee.work_end * 60),
|
||||
end: dayEnd,
|
||||
split: index + 1,
|
||||
type: 'non-working-hours',
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
})
|
||||
})
|
||||
|
||||
this.calendarConfig.scrollHour = (earliestStartMinutes) - 1
|
||||
this.calendarConfig.scrollHour = (earliestHour) - 1
|
||||
return nonWorkingHours
|
||||
},
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ export default {
|
||||
|
||||
const data = {
|
||||
id: this.user.id,
|
||||
work_start: parseFloat(sHours) * 60 + parseFloat(sMinutes),
|
||||
work_end: parseFloat(eHours) * 60 + parseFloat(eMinutes)
|
||||
work_start: parseFloat(sHours) + parseFloat(sMinutes) / 60,
|
||||
work_end: parseFloat(eHours) + parseFloat(eMinutes) / 60
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -69,14 +69,23 @@ export default {
|
||||
|
||||
_setDates() {
|
||||
this.form = {
|
||||
work_start: this.minutesToTime(this.user.work_start),
|
||||
work_end: this.minutesToTime(this.user.work_end)
|
||||
work_start: this.decimalHoursToTime(this.user.work_start),
|
||||
work_end: this.decimalHoursToTime(this.user.work_end)
|
||||
}
|
||||
},
|
||||
|
||||
minutesToTime(minutes) {
|
||||
var hours = Math.floor(minutes / 60)
|
||||
var mins = minutes % 60
|
||||
// minutesToTime(minutes) {
|
||||
// var hours = Math.floor(minutes / 60)
|
||||
// var mins = minutes % 60
|
||||
// hours = (hours < 10 ? '0' : '') + hours
|
||||
// mins = (mins < 10 ? '0' : '') + mins
|
||||
|
||||
// return hours + ':' + mins
|
||||
// },
|
||||
|
||||
decimalHoursToTime(decimalHours) {
|
||||
var hours = Math.floor(decimalHours)
|
||||
var mins = Math.floor((decimalHours * 60) % 60)
|
||||
hours = (hours < 10 ? '0' : '') + hours
|
||||
mins = (mins < 10 ? '0' : '') + mins
|
||||
|
||||
|
||||
Reference in new issue
Block a user