Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
bbc2ca40
Commit
bbc2ca40
authored
Jun 29, 2018
by
Orlando Del Aguila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save current date before Pikaday init
parent
00c1a58b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
app/assets/javascripts/due_date_select.js
app/assets/javascripts/due_date_select.js
+3
-1
changelogs/unreleased/41671-fixing-milestone-date-change-when-editing.yml
...eased/41671-fixing-milestone-date-change-when-editing.yml
+5
-0
spec/features/milestones/user_edits_milestone_spec.rb
spec/features/milestones/user_edits_milestone_spec.rb
+22
-0
No files found.
app/assets/javascripts/due_date_select.js
View file @
bbc2ca40
...
@@ -170,6 +170,8 @@ export default class DueDateSelectors {
...
@@ -170,6 +170,8 @@ export default class DueDateSelectors {
initMilestoneDatePicker
()
{
initMilestoneDatePicker
()
{
$
(
'
.datepicker
'
).
each
(
function
initPikadayMilestone
()
{
$
(
'
.datepicker
'
).
each
(
function
initPikadayMilestone
()
{
const
$datePicker
=
$
(
this
);
const
$datePicker
=
$
(
this
);
const
datePickerVal
=
$datePicker
.
val
();
const
calendar
=
new
Pikaday
({
const
calendar
=
new
Pikaday
({
field
:
$datePicker
.
get
(
0
),
field
:
$datePicker
.
get
(
0
),
theme
:
'
gitlab-theme animate-picker
'
,
theme
:
'
gitlab-theme animate-picker
'
,
...
@@ -182,7 +184,7 @@ export default class DueDateSelectors {
...
@@ -182,7 +184,7 @@ export default class DueDateSelectors {
},
},
});
});
calendar
.
setDate
(
parsePikadayDate
(
$datePicker
.
val
()
));
calendar
.
setDate
(
parsePikadayDate
(
datePickerVal
));
$datePicker
.
data
(
'
pikaday
'
,
calendar
);
$datePicker
.
data
(
'
pikaday
'
,
calendar
);
});
});
...
...
changelogs/unreleased/41671-fixing-milestone-date-change-when-editing.yml
0 → 100644
View file @
bbc2ca40
---
title
:
"
Fixing
milestone
date
change
when
editing"
merge_request
:
20279
author
:
Orlando Del Aguila
type
:
fixed
\ No newline at end of file
spec/features/milestones/user_edits_milestone_spec.rb
0 → 100644
View file @
bbc2ca40
require
"rails_helper"
describe
"User edits milestone"
,
:js
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
set
(
:milestone
)
{
create
(
:milestone
,
project:
project
,
start_date:
Date
.
today
,
due_date:
5
.
days
.
from_now
)
}
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
visit
(
edit_project_milestone_path
(
project
,
milestone
))
end
it
"shows the right start date and due date"
do
start_date
=
milestone
.
start_date
.
strftime
(
"%F"
)
due_date
=
milestone
.
due_date
.
strftime
(
"%F"
)
expect
(
page
).
to
have_field
(
with:
start_date
)
expect
(
page
).
to
have_field
(
with:
due_date
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment