Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
c212719b
Commit
c212719b
authored
3 years ago
by
David Siegfried
Browse files
Options
Downloads
Patches
Plain Diff
datepicker handling simplified, refs #187
parent
bbcf2b47
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/views/resources/room_planning/_sidebar_date_selection.php
+2
-7
2 additions, 7 deletions
...views/resources/room_planning/_sidebar_date_selection.php
resources/assets/javascripts/bootstrap/resources.js
+24
-31
24 additions, 31 deletions
resources/assets/javascripts/bootstrap/resources.js
with
26 additions
and
38 deletions
app/views/resources/room_planning/_sidebar_date_selection.php
+
2
−
7
View file @
c212719b
...
@@ -6,15 +6,10 @@
...
@@ -6,15 +6,10 @@
$default_date
=
strftime
(
'%x'
,
time
());
$default_date
=
strftime
(
'%x'
,
time
());
}
}
?>
?>
<?=
\Studip\Button
::
create
(
<?=
\Studip\
Link
Button
::
create
(
_
(
'Heute'
),
_
(
'Heute'
),
'today'
,
URLHelper
::
getURL
(
''
,
[
'defaultDate'
=>
date
(
'Y-m-d'
,
time
())])
[
'id'
=>
'booking-plan-jmpdate-button'
,
'onClick'
=>
"$('#booking-plan-jmpdate').val('"
.
strftime
(
'%x'
,
time
())
.
"');$('#booking-plan-jmpdate-submit').trigger('click');"
]
);
?>
);
?>
<input
id=
"booking-plan-jmpdate"
type=
"text"
<input
id=
"booking-plan-jmpdate"
type=
"text"
name=
"booking-plan-jmpdate"
value=
"
<?=
$default_date
;
?>
"
>
name=
"booking-plan-jmpdate"
value=
"
<?=
$default_date
;
?>
"
>
<?=
Icon
::
create
(
'accept'
,
'clickable'
)
->
asInput
([
'id'
=>
'booking-plan-jmpdate-submit'
,
'class'
=>
'text-top'
])
?>
This diff is collapsed.
Click to expand it.
resources/assets/javascripts/bootstrap/resources.js
+
24
−
31
View file @
c212719b
...
@@ -506,36 +506,6 @@ STUDIP.ready(function () {
...
@@ -506,36 +506,6 @@ STUDIP.ready(function () {
}
}
);
);
jQuery
(
document
).
on
(
'
click
'
,
'
#booking-plan-jmpdate-submit
'
,
function
()
{
var
picked
=
$
(
'
#booking-plan-jmpdate
'
).
val
();
var
iso_date_string
=
''
;
if
(
picked
.
includes
(
'
.
'
))
{
var
good_format
=
picked
.
split
(
'
.
'
);
var
day
=
good_format
[
0
];
var
month
=
good_format
[
1
];
var
year
=
good_format
[
2
];
iso_date_string
=
year
.
padStart
(
4
,
"
20
"
)
+
'
-
'
+
month
.
padStart
(
2
,
"
0
"
)
+
'
-
'
+
day
.
padStart
(
2
,
"
0
"
);
}
else
if
(
picked
.
includes
(
'
/
'
))
{
var
bad_format
=
picked
.
split
(
'
/
'
);
var
day
=
bad_format
[
1
];
var
month
=
bad_format
[
0
];
var
year
=
bad_format
[
2
];
iso_date_string
=
year
.
padStart
(
4
,
"
20
"
)
+
'
-
'
+
month
.
padStart
(
2
,
"
0
"
)
+
'
-
'
+
day
.
padStart
(
2
,
"
0
"
);
}
else
if
(
picked
.
includes
(
'
-
'
))
{
iso_date_string
=
picked
;
}
if
(
iso_date_string
)
{
$
(
'
*[data-resources-fullcalendar="1"]
'
).
each
(
function
()
{
$
(
this
)[
0
].
calendar
.
gotoDate
(
iso_date_string
);
});
updateDateURL
();
}
}
);
jQuery
(
document
).
on
(
jQuery
(
document
).
on
(
'
change
'
,
'
change
'
,
'
select[name="special__time_range_semester_id"]
'
,
'
select[name="special__time_range_semester_id"]
'
,
...
@@ -691,6 +661,28 @@ STUDIP.ready(function () {
...
@@ -691,6 +661,28 @@ STUDIP.ready(function () {
$
(
'
.booking-plan-allday_view
'
).
attr
(
'
href
'
,
std_day
+
'
&allday=1
'
);
$
(
'
.booking-plan-allday_view
'
).
attr
(
'
href
'
,
std_day
+
'
&allday=1
'
);
};
};
function
submitDatePicker
()
{
var
picked
=
$
(
'
#booking-plan-jmpdate
'
).
val
();
var
iso_date_string
=
''
;
if
(
picked
)
{
if
(
picked
.
includes
(
'
.
'
))
{
let
[
day
,
month
,
year
]
=
picked
.
split
(
'
.
'
);
iso_date_string
=
year
.
padStart
(
4
,
"
20
"
)
+
'
-
'
+
month
.
padStart
(
2
,
"
0
"
)
+
'
-
'
+
day
.
padStart
(
2
,
"
0
"
);
}
else
if
(
picked
.
includes
(
'
/
'
))
{
let
[
day
,
month
,
year
]
=
picked
.
split
(
'
/
'
);
iso_date_string
=
year
.
padStart
(
4
,
"
20
"
)
+
'
-
'
+
month
.
padStart
(
2
,
"
0
"
)
+
'
-
'
+
day
.
padStart
(
2
,
"
0
"
);
}
else
if
(
picked
.
includes
(
'
-
'
))
{
iso_date_string
=
picked
;
}
}
if
(
iso_date_string
)
{
$
(
'
*[data-resources-fullcalendar="1"]
'
).
each
(
function
()
{
this
.
calendar
.
gotoDate
(
iso_date_string
);
});
updateDateURL
();
}
}
function
updateDateURL
()
{
function
updateDateURL
()
{
var
changedmoment
;
var
changedmoment
;
$
(
'
*[data-resources-fullcalendar="1"]
'
).
each
(
function
()
{
$
(
'
*[data-resources-fullcalendar="1"]
'
).
each
(
function
()
{
...
@@ -755,7 +747,8 @@ STUDIP.ready(function () {
...
@@ -755,7 +747,8 @@ STUDIP.ready(function () {
jQuery
(
'
#booking-plan-jmpdate
'
).
datepicker
(
jQuery
(
'
#booking-plan-jmpdate
'
).
datepicker
(
{
{
dateFormat
:
'
dd.mm.yy
'
dateFormat
:
'
dd.mm.yy
'
,
onClose
:
submitDatePicker
}
}
);
);
jQuery
(
'
.resource-booking-time-fields input[type="date"]
'
).
datepicker
(
jQuery
(
'
.resource-booking-time-fields input[type="date"]
'
).
datepicker
(
...
...
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