Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sib-polls-component
Manage
Activity
Members
Labels
Plan
Issues
9
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Applications
etuc
sib-polls-component
Commits
7b3e0e25
Commit
7b3e0e25
authored
4 years ago
by
Maxime
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: fix displayed change of date in error message
parent
291eb2d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!19
bugfix: fix displayed change of date in error message
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/main.js
+6
-6
6 additions, 6 deletions
js/main.js
with
6 additions
and
6 deletions
js/main.js
+
6
−
6
View file @
7b3e0e25
...
...
@@ -273,10 +273,10 @@ function disableVotes(){
//console.log("current poll is :", currentPoll);
//console.log("startdate block is :", currentPoll.querySelector("solid-display-date[name=startDate]"));
let
dateSeparator
=
"
/
"
;
let
s
tartDate
=
currentPoll
.
querySelector
(
"
solid-display-date[name=startDate]
"
).
textContent
;
startDate
=
s
tartDate
.
split
(
"
/
"
);
let
e
ndDate
=
currentPoll
.
querySelector
(
"
solid-display-date[name=endDate]
"
).
textContent
;
let
cleanEndDate
=
e
ndDate
.
split
(
"
/
"
);
let
displayS
tartDate
=
currentPoll
.
querySelector
(
"
solid-display-date[name=startDate]
"
).
textContent
;
startDate
=
displayS
tartDate
.
split
(
"
/
"
);
let
displayE
ndDate
=
currentPoll
.
querySelector
(
"
solid-display-date[name=endDate]
"
).
textContent
;
let
cleanEndDate
=
displayE
ndDate
.
split
(
"
/
"
);
cleanStartDate
=
startDate
[
1
]
+
dateSeparator
+
startDate
[
0
]
+
dateSeparator
+
startDate
[
2
];
cleanEndDate
=
cleanEndDate
[
1
]
+
dateSeparator
+
cleanEndDate
[
0
]
+
dateSeparator
+
cleanEndDate
[
2
];
...
...
@@ -296,10 +296,10 @@ function disableVotes(){
let
submitButton
=
votingSection
.
querySelector
(
"
input[type=submit]
"
);
if
(
comparisonStartDate
>
date
)
{
let
errorMessage
=
"
This poll hasn't started yet, you can start voting on :
"
+
s
tartDate
+
"
.
"
;
let
errorMessage
=
"
This poll hasn't started yet, you can start voting on :
"
+
displayS
tartDate
+
"
.
"
;
deactivateButton
(
errorMessage
);
}
else
if
(
comparisonEndDate
<
date
)
{
let
errorMessage
=
"
This poll is closed since :
"
+
e
ndDate
+
"
.
"
;
let
errorMessage
=
"
This poll is closed since :
"
+
displayE
ndDate
+
"
.
"
;
deactivateButton
(
errorMessage
);
}
else
if
(
comparisonEndDate
=
date
)
{
...
...
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