Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
framadate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Nounous
framadate
Commits
1c8a41dc
Commit
1c8a41dc
authored
9 years ago
by
Olivier PEREZ
Browse files
Options
Downloads
Patches
Plain Diff
Add has-error CSS class when dates are not ordered + stop checking if first date is not passed
parent
c2f5c473
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-1
1 addition, 1 deletion
CHANGELOG.md
js/app/date_poll.js
+12
-7
12 additions, 7 deletions
js/app/date_poll.js
with
13 additions
and
8 deletions
CHANGELOG.md
+
1
−
1
View file @
1c8a41dc
...
...
@@ -103,7 +103,7 @@
## Changelog du 21 juin 2011 (pyg@framasoft.net)
-
très nombreuses modifications CSS
-
modification adminstuds.php : ajout de classes aux formulaires et ajout de stripslashes à l'affichage
(TODO: à généraliser)
-
modification adminstuds.php : ajout de classes aux formulaires et ajout de stripslashes à l'affichage
-
modification infos_sondages.php : simplification du tableau de choix, ajouts de CSS, ajouts de labels pour faciliter la selection
## Changelog version 0.6.7 (mai 2011)
...
...
This diff is collapsed.
Click to expand it.
js/app/date_poll.js
+
12
−
7
View file @
1c8a41dc
...
...
@@ -54,7 +54,7 @@ $(document).ready(function () {
// creates assoc array for date
var
df
=
[];
for
(
var
dc
=
0
;
dc
<
6
;
dc
++
)
{
for
(
var
dc
=
0
;
dc
<
dtsplit
.
length
;
dc
++
)
{
df
[
dfsplit
[
dc
]]
=
dtsplit
[
dc
];
}
...
...
@@ -77,7 +77,6 @@ $(document).ready(function () {
var
re_id_hours
=
new
RegExp
(
'
"d
'
+
(
nb_days
-
1
)
+
'
-h
'
,
'
g
'
);
var
re_name_hours
=
new
RegExp
(
'
name="horaires
'
+
(
nb_days
-
1
),
'
g
'
);
// TODO Faire mieux que remplacer des chaines de caractères
var
new_day_html
=
last_day
.
html
().
replace
(
re_id_hours
,
'
"d
'
+
nb_days
+
'
-h
'
)
.
replace
(
'
id="day
'
+
(
nb_days
-
1
)
+
'
"
'
,
'
id="day
'
+
nb_days
+
'
"
'
)
.
replace
(
'
for="day
'
+
(
nb_days
-
1
)
+
'
"
'
,
'
for="day
'
+
nb_days
+
'
"
'
)
...
...
@@ -234,13 +233,16 @@ $(document).ready(function () {
var
startDate
=
parseDate
(
startDateField
.
val
(),
window
.
date_formats
.
DATE
);
var
endDate
=
parseDate
(
endDateField
.
val
(),
window
.
date_formats
.
DATE
);
console
.
log
(
'
start_date as date
'
,
startDate
);
console
.
log
(
'
start_end as date
'
,
endDate
);
// Clear error classes
startDateField
.
parent
().
removeClass
(
'
has-error
'
);
endDateField
.
parent
().
removeClass
(
'
has-error
'
);
if
(
startDate
<=
endDate
&&
startDate
>
new
Date
())
{
// console.log('start_date as date', startDate);
// console.log('start_end as date', endDate);
if
(
startDate
<=
endDate
)
{
while
(
startDate
<=
endDate
)
{
var
dateStr
=
formatDate
(
startDate
,
window
.
date_formats
.
DATE
);
if
(
!
useFirstEmptyDateField
(
dateStr
))
{
if
(
!
useFirstEmptyDateField
(
dateStr
))
{
newDateFields
(
dateStr
);
}
startDate
.
setDate
(
startDate
.
getDate
()
+
1
);
...
...
@@ -251,8 +253,11 @@ $(document).ready(function () {
endDateField
.
val
(
''
);
$
(
'
#add_days
'
).
modal
(
'
hide
'
);
submitDaysAvalaible
();
}
else
{
console
.
log
(
'
err
'
);
startDateField
.
parent
().
addClass
(
'
has-error
'
);
endDateField
.
parent
().
addClass
(
'
has-error
'
);
}
});
...
...
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