Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IDATT2106 - Gruppe 2
idatt2106_2024_02_frontend
Commits
60b81e80
Commit
60b81e80
authored
11 months ago
by
Trygve Jørgensen
Browse files
Options
Downloads
Patches
Plain Diff
refactor(goal): due date only has a min value
parent
85ee8282
No related branches found
No related tags found
3 merge requests
!66
Final merge
,
!30
Feat/10 finalize goals
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/ManageGoalView.vue
+6
-20
6 additions, 20 deletions
src/views/ManageGoalView.vue
with
6 additions
and
20 deletions
src/views/ManageGoalView.vue
+
6
−
20
View file @
60b81e80
...
...
@@ -7,24 +7,15 @@ import authInterceptor from '@/services/authInterceptor'
const
router
=
useRouter
()
const
oneWeekFromNow
=
new
Date
()
oneWeekFromNow
.
setDate
(
oneWeekFromNow
.
getDate
()
+
7
)
const
minDate
=
oneWeekFromNow
.
toISOString
().
slice
(
0
,
16
)
const
thirtyDaysFromNow
=
new
Date
()
thirtyDaysFromNow
.
setDate
(
thirtyDaysFromNow
.
getDate
()
+
30
)
const
maxDate
=
thirtyDaysFromNow
.
toISOString
().
slice
(
0
,
16
)
const
selectedDate
=
ref
<
string
>
(
''
)
const
minDate
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
+
1
)).
toISOString
().
slice
(
0
,
16
)
const
goalInstance
=
ref
<
Goal
>
({
id
:
0
,
title
:
''
,
saved
:
0
,
target
:
100
,
completion
:
0
,
description
:
''
,
priority
:
0
,
createdOn
:
undefined
,
due
:
minDate
+
'
:00.000Z
'
due
:
''
})
watch
(
...
...
@@ -41,15 +32,11 @@ watch(
}
)
const
selectedDate
=
ref
(
minDate
)
watch
(
()
=>
selectedDate
.
value
,
(
newVal
)
=>
{
if
(
newVal
)
{
selectedDate
.
value
=
newVal
<
minDate
?
minDate
:
newVal
goalInstance
.
value
.
due
=
selectedDate
.
value
+
'
:00.000Z
'
}
console
.
log
(
selectedDate
.
value
)
if
(
newVal
<
minDate
)
selectedDate
.
value
=
minDate
goalInstance
.
value
.
due
=
newVal
+
'
:00.000Z
'
}
)
...
...
@@ -178,9 +165,8 @@ const deleteGoal = () => {
<div
class=
"flex flex-col"
>
<p
class=
"mx-4"
>
Forfallsdato*
</p>
<input
v-model=
"selectedDate"
:max=
"maxDate"
:min=
"minDate"
v-model=
"selectedDate"
placeholder=
"Forfallsdato"
type=
"datetime-local"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment