BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6003f6ea
Commit
6003f6ea
authored
Jan 06, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-timezone-due-date-picker' into 'master'
Fix timezone due date picker Closes #24253 See merge request !8081
parents
81dfb1aa
55fe57eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
due_date_select.js.es6
app/assets/javascripts/due_date_select.js.es6
+5
-2
_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
fix-timezone-due-date-picker.yml
changelogs/unreleased/fix-timezone-due-date-picker.yml
+4
-0
issues_spec.rb
spec/features/issues_spec.rb
+8
-2
No files found.
app/assets/javascripts/due_date_select.js.es6
View file @
6003f6ea
...
...
@@ -80,9 +80,12 @@
}
parseSelectedDate() {
this.rawSelectedDate = $("input[name='" + this.fieldName + "']").val();
this.rawSelectedDate = $(`input[name='${this.fieldName}']`).val();
if (this.rawSelectedDate.length) {
let dateObj = new Date(this.rawSelectedDate);
// Construct Date object manually to avoid buggy dateString support within Date constructor
const dateArray = this.rawSelectedDate.split('-').map(v => parseInt(v, 10));
const dateObj = new Date(dateArray[0], dateArray[1] - 1, dateArray[2]);
this.displayedDate = $.datepicker.formatDate('M d, yy', dateObj);
} else {
this.displayedDate = 'No due date';
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
6003f6ea
...
...
@@ -97,7 +97,7 @@
remove due date
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
.selectbox.hide-collapsed
=
f
.
hidden_field
:due_date
,
value:
issuable
.
due_date
=
f
.
hidden_field
:due_date
,
value:
issuable
.
due_date
.
try
(
:strftime
,
'yy-mm-dd'
)
.dropdown
%button
.dropdown-menu-toggle.js-due-date-select
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
field_name:
"#{issuable.to_ability_name}[due_date]"
,
ability_name:
issuable
.
to_ability_name
,
issue_update:
issuable_json_path
(
issuable
)
}
}
%span
.dropdown-toggle-text
Due date
...
...
changelogs/unreleased/fix-timezone-due-date-picker.yml
0 → 100644
View file @
6003f6ea
---
title
:
Fix date inconsistency on due date picker
merge_request
:
7422
author
:
Giuliano Varriale
spec/features/issues_spec.rb
View file @
6003f6ea
...
...
@@ -619,14 +619,18 @@ describe 'Issues', feature: true do
end
it
'adds due date to issue'
do
date
=
Date
.
today
.
at_beginning_of_month
+
2
.
days
page
.
within
'.due_date'
do
click_link
'Edit'
page
.
within
'.ui-datepicker-calendar'
do
first
(
'.ui-state-default'
).
click
click_link
date
.
day
end
expect
(
page
).
to
have_no_content
'None'
wait_for_ajax
expect
(
find
(
'.value'
).
text
).
to
have_content
date
.
strftime
(
'%b %-d, %Y'
)
end
end
...
...
@@ -638,6 +642,8 @@ describe 'Issues', feature: true do
first
(
'.ui-state-default'
).
click
end
wait_for_ajax
expect
(
page
).
to
have_no_content
'No due date'
click_link
'remove due date'
...
...
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