Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Chronos
Commits
ede9d945
Verified
Commit
ede9d945
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Use django-generated URLs for next/previous buttons in datepicker
parent
f74fd4c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!31
Biscuit merge. Closes #53.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/chronos/static/js/chronos/date_select.js
+1
-25
1 addition, 25 deletions
aleksis/apps/chronos/static/js/chronos/date_select.js
aleksis/apps/chronos/templates/chronos/partials/datepicker.html
+5
-5
5 additions, 5 deletions
...s/apps/chronos/templates/chronos/partials/datepicker.html
with
6 additions
and
30 deletions
aleksis/apps/chronos/static/js/chronos/date_select.js
+
1
−
25
View file @
ede9d945
...
...
@@ -14,31 +14,9 @@ function loadNew() {
window
.
location
.
href
=
dest
+
formatDateForDjango
(
activeDate
);
}
function
onDateBeforeClick
()
{
if
(
activeDate
.
getDay
()
===
1
)
{
var
minus
=
3
;
}
else
{
var
minus
=
1
;
}
activeDate
.
setDate
(
activeDate
.
getDate
()
-
minus
);
update
();
loadNew
();
}
function
onDateNextClick
()
{
if
(
activeDate
.
getDay
()
===
5
)
{
var
plus
=
3
;
}
else
{
var
plus
=
1
;
}
activeDate
.
setDate
(
activeDate
.
getDate
()
+
plus
);
update
();
loadNew
();
}
function
onDateChanged
()
{
var
str
=
$
(
"
#date
"
).
val
();
var
split
=
str
.
split
(
"
.
"
)
var
split
=
str
.
split
(
"
.
"
)
;
activeDate
=
new
Date
(
split
[
2
],
split
[
1
]
-
1
,
split
[
0
]);
update
();
loadNew
();
...
...
@@ -46,8 +24,6 @@ function onDateChanged() {
$
(
document
).
ready
(
function
()
{
$
(
"
#date-before
"
).
click
(
onDateBeforeClick
);
$
(
"
#date-next
"
).
click
(
onDateNextClick
);
$
(
"
#date
"
).
change
(
onDateChanged
);
update
();
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/chronos/templates/chronos/partials/datepicker.html
+
5
−
5
View file @
ede9d945
...
...
@@ -8,8 +8,8 @@
<script
type=
"text/javascript"
src=
"{% static "
js
/
chronos
/
date_select.js
"
%}"
></script>
<div
class=
"col s2"
style=
"display: initial;"
>
<a
class=
"waves-effect waves-teal btn-flat btn-flat-medium left"
id=
"date-before
"
>
<div
class=
"col s2
no-padding
"
style=
"display: initial;"
>
<a
class=
"waves-effect waves-teal btn-flat btn-flat-medium left"
href=
"{{ url_prev }}
"
>
<i
class=
"material-icons center"
>
navigate_before
</i>
</a>
...
...
@@ -21,12 +21,12 @@
</span>
</div>
{% else %}
<div
class=
"col s8"
>
<div
class=
"col s8
no-padding
"
>
<input
type=
"text"
class=
"datepicker center-align"
id=
"date"
>
</div>
{% endif %}
<div
class=
"col s2"
style=
"display: initial;"
>
<a
class=
"waves-effect waves-teal btn-flat btn-flat-medium right"
id=
"date-
next"
>
<div
class=
"col s2
no-padding
"
style=
"display: initial;"
>
<a
class=
"waves-effect waves-teal btn-flat btn-flat-medium right"
href=
"{{ url_
next
}}
"
>
<i
class=
"material-icons center"
>
navigate_next
</i>
</a>
</div>
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