kamilabs / bookingbundle Goto Github PK
View Code? Open in Web Editor NEWBooking Bundle for Symfony Applications
License: MIT License
Booking Bundle for Symfony Applications
License: MIT License
Builds should be passing using latest stable Sf 3.4, 4.2
Hi,
I've noticed two bugs:
When we are the 30th of the month and using kami_booking_calendar twig function, month render is false, for exemple I changed the date of my system to 2018-09-30 and march 2019 appears twice, I have : january ,march,march, Apri etc..
I rewrite some code if you want to re-use it:
`
{% set year = start|date('Y') %}
{% set month = start|date('m') %}
{% for i in 1..months %}
{% if month ==13 %}
{% set month = 1 %}
{% set year = year +1 %}
{% endif %}
{% set date =year~"-"~month~"-01" %}
{% set first_day_index= date|date('w') %}
{% set number_of_days = date|date_modify('last day of this month')|date('d') %}
{% set number_of_rows =(((number_of_days+first_day_index)-1)/7)|round(0, 'ceil') %}
{% set current_day = 1 %}
<table class="cf-booking-calendar table table-bordered {% if loop.last %}last{% endif %}" id="month{{ loop.index }}" data-item="{{ loop.index }}">
<tr class="cf-booking-calendar-m">
<th colspan="7">{{ date|date("F Y") }}</th>
</tr>
<tr>
<th class="cf-booking-calendar-dow">Mon</th>
<th class="cf-booking-calendar-dow">Tue</th>
<th class="cf-booking-calendar-dow">Wed</th>
<th class="cf-booking-calendar-dow">Thi</th>
<th class="cf-booking-calendar-dow">Fri</th>
<th class="cf-booking-calendar-dow">Sat</th>
<th class="cf-booking-calendar-dow">Sun</th>
</tr>
{% for row_index in 1..number_of_rows %}
<tr>
{% for day_index in 1..7 %}
{% if (row_index ==1 and day_index >= first_day_index) or (row_index > 1 and current_day<=number_of_days) %}
{% set day_string = current_day <10 ? "0"~current_day : current_day %}
{% set current_date = year~"-"~month~"-"~day_string %}
{% set booked = 0 %}
{% set is_opener = 0 %}
{% set is_closer = 0 %}
{% for booking in bookings %}
{% if current_date|date("U") >= booking.start|date("U") and current_date|date("U") <= booking.end|date("U") %}
{% set booked = 1 %}
{% endif %}
{% if current_date|date("d F Y") == booking.start|date("d F Y") %}
{% set is_opener = 1 %}
{% endif %}
{% if current_date|date("d F Y") == booking.end|date("d F Y") %}
{% set is_closer = 1 %}
{% endif %}
{% endfor %}
<td data-formatdate="{{ current_date| date("U") }}" class="cf-booking-calendar-d {{ booked == 1 ? 'booked' : '' }} {{ is_opener == 1 ? 'opener':''}} {{ is_closer == 1 ? 'closer':'' }} {{ current_date|date("U") < "now" |date("U") ? 'muted':'' }}">
{{ current_day }}
</td>
{% set current_day=current_day+1 %}
{% else %}
<td class="cf-booking-calendar-empty "></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</table>
{% set month = month+1 %}
{% endfor %}`
Apparently the definition of your twig extension service 'booking_calendar' is false, first given argument is '%kami.booking_calendar.class%' but i think it must be '%kami.booker.entity_class%' because you call doctrine repository using this argument.
Hello Everyone !
Will there be an update for version 5 of symfony ?
Thanks
When trying to install this package on Symfony 2.8.25, I get the error message:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for kami/booking-bundle ^1.0 -> satisfiable by kami/booking-bundle[1.0].
- Conclusion: remove symfony/debug v2.8.25
- Conclusion: don't install symfony/debug v2.8.25
- Can only install one of: symfony/symfony[v3.0.9, v2.8.25].
- don't install symfony/symfony v2.8.25|remove symfony/twig-bridge v3.0.9
- don't install symfony/twig-bridge v3.0.9|don't install symfony/symfony v2.8.25
- Installation request for symfony/debug (installed at v2.8.25) -> satisfiable by symfony/debug[v2.8.25], symfony/symfony[v2.8.25].
- Installation request for symfony/twig-bridge (installed at v3.0.9) -> satisfiable by symfony/symfony[v3.0.9], symfony/twig-bridge[v3.0.9].
What is the proper Symfony2 version (as there is no Symfony3 support yet)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.