diff --git a/README.md b/README.md
index f2f5c96..bbeeb4a 100644
--- a/README.md
+++ b/README.md
@@ -79,8 +79,7 @@ Le visiteur doit pouvoir :
- Page service : navette + location
- Gestion du calendrier
- .._ Google calendar pour afficher les disponibilités
- .._ Check si les dates choisies sont libres
+ ..\_ Google calendar pour afficher les disponibilités
- Envoyer devis réservation par mail et notification aux hôtes
- Ajout page/module de paiement
- ajouter les témoignages depuis Booking, AirBnb, ajouter le lien
diff --git a/rental/calendar.py b/rental/calendar.py
new file mode 100644
index 0000000..b738bea
--- /dev/null
+++ b/rental/calendar.py
@@ -0,0 +1,17 @@
+def get_bookings(place):
+ """
+ returns a list of all related place reservations
+ """
+ booked_dates = Reservation.objects.all()
+ return [booking for booking in booked_dates if booking.place.name == f"{place.name}"]
+
+
+def check_availability(place, start_date, end_date):
+ """
+ check if the related place is available during a given period
+ """
+ bookings = get_bookings(place)
+ for booking in bookings:
+ if (booking.start <= start_date <= booking.end) or (booking.start <= end_date <= booking.end):
+ return False
+ return True
diff --git a/rental/templates/rental/calendar.html b/rental/templates/rental/calendar.html
new file mode 100644
index 0000000..f548ad8
--- /dev/null
+++ b/rental/templates/rental/calendar.html
@@ -0,0 +1,25 @@
+{% extends 'rental/base.html' %} {% block content %}
+
+
+
+
+
+
+ Calendrier {{place_name}}
+
+ {% for booking in bookings %}
+
+ {{booking.guest.name}}
+
+
+
Réservation du {{booking.start}} au {{booking.end}}