Komfort brechnung mit Kind Kalender im Admin formatieren
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3454 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
0325e97509
commit
4ee51802ab
6 changed files with 210 additions and 63 deletions
|
|
@ -89,6 +89,7 @@
|
|||
|
||||
|
||||
<style>
|
||||
|
||||
.table > tbody > tr > td.normal {
|
||||
background-color: #deebde;
|
||||
padding: 6px;
|
||||
|
|
|
|||
|
|
@ -86,11 +86,18 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
|
||||
var checkDates = function(date) {
|
||||
var formatted = date.format('DD.MM.YYYY');
|
||||
var reservationDays = "{{ reservationDays }}";
|
||||
checkDates = function(date) {
|
||||
formatted = date.format('DD.MM.YYYY');
|
||||
reservationDays = {{ reservationDays|json_encode|raw }}
|
||||
return reservationDays.indexOf(formatted) > -1;
|
||||
}
|
||||
};
|
||||
checkCustom = function(date) {
|
||||
customDays = {{ classByDays|json_encode|raw }};
|
||||
formatted = date.format('DD.MM.YYYY');
|
||||
if(customDays[formatted] != undefined){
|
||||
return customDays[formatted];
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
|
@ -103,6 +110,7 @@
|
|||
|
||||
$('#appbundle_feworeservation_fromDate, #appbundle_feworeservation_toDate').daterangepicker({
|
||||
isInvalidDate: checkDates,
|
||||
isCustomDate: checkCustom,
|
||||
"minDate": moment(),
|
||||
"maxDate": maxDate,
|
||||
"timePickerSeconds": true,
|
||||
|
|
@ -131,7 +139,7 @@
|
|||
"Februar",
|
||||
"März",
|
||||
"April",
|
||||
"Kann",
|
||||
"Mai",
|
||||
"Juni",
|
||||
"Juli",
|
||||
"August",
|
||||
|
|
@ -147,6 +155,7 @@
|
|||
"startDate": startDate,
|
||||
"endDate": endDate,
|
||||
}, function(start, end, label) {
|
||||
console.log(start);
|
||||
// console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
|
||||
// Lets update the fields manually this event fires on selection of range
|
||||
var selectedStartDate = start.format('DD.MM.YYYY'); // selected start
|
||||
|
|
@ -170,6 +179,11 @@
|
|||
checkInPicker.setEndDate(selectedEndDate);
|
||||
|
||||
});
|
||||
|
||||
$('#appbundle_feworeservation_fromDate, #appbundle_feworeservation_toDate').on('show.daterangepicker', function(ev, picker) {
|
||||
console.log(picker.startDate.format('YYYY-MM-DD'));
|
||||
console.log(picker.endDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -81,11 +81,18 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
|
||||
var checkDates = function(date) {
|
||||
var formatted = date.format('DD.MM.YYYY');
|
||||
var reservationDays = "{{ reservationDays }}";
|
||||
checkDates = function(date) {
|
||||
formatted = date.format('DD.MM.YYYY');
|
||||
reservationDays = {{ reservationDays|json_encode|raw }}
|
||||
return reservationDays.indexOf(formatted) > -1;
|
||||
}
|
||||
};
|
||||
checkCustom = function(date) {
|
||||
customDays = {{ classByDays|json_encode|raw }};
|
||||
formatted = date.format('DD.MM.YYYY');
|
||||
if(customDays[formatted] != undefined){
|
||||
return customDays[formatted];
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
|
@ -98,6 +105,7 @@
|
|||
|
||||
$('#appbundle_feworeservation_fromDate, #appbundle_feworeservation_toDate').daterangepicker({
|
||||
isInvalidDate: checkDates,
|
||||
isCustomDate: checkCustom,
|
||||
"minDate": moment(),
|
||||
"maxDate": maxDate,
|
||||
"timePickerSeconds": true,
|
||||
|
|
@ -126,7 +134,7 @@
|
|||
"Februar",
|
||||
"März",
|
||||
"April",
|
||||
"Kann",
|
||||
"Mai",
|
||||
"Juni",
|
||||
"Juli",
|
||||
"August",
|
||||
|
|
@ -142,6 +150,7 @@
|
|||
"startDate": startDate,
|
||||
"endDate": endDate,
|
||||
}, function(start, end, label) {
|
||||
console.log(start);
|
||||
// console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
|
||||
// Lets update the fields manually this event fires on selection of range
|
||||
var selectedStartDate = start.format('DD.MM.YYYY'); // selected start
|
||||
|
|
@ -165,6 +174,11 @@
|
|||
checkInPicker.setEndDate(selectedEndDate);
|
||||
|
||||
});
|
||||
|
||||
$('#appbundle_feworeservation_fromDate, #appbundle_feworeservation_toDate').on('show.daterangepicker', function(ev, picker) {
|
||||
console.log(picker.startDate.format('YYYY-MM-DD'));
|
||||
console.log(picker.endDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock body %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue