Bonjour,
Bonjour,
donc je veux mettre dans ma page reservation un calendrier parnettant de selectionner les dates de darivé et de depart
je suis debutante donk je galère bokou
si pouviez mindiquer les erreurs de mon script cela m'aiderai bokou
c le script reservation
<html>
<head>
<title>Réserver un gîte</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<head>
<script type="text/javascript" language="JavaScript">
var NUM_CENTYEAR = 30;
var BUL_TIMECOMPONENT = false;
var BUL_YEARSCROLL = true;
var calendars = [];
var RE_NUM = /^\-?\d+$/;
if (!obj_target)
return cal_error("Error calling the calendar: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the calendar: parameter specified is not valid target control");
this.target = obj_target;
this.time_comp = BUL_TIMECOMPONENT;
this.year_scroll = BUL_YEARSCROLL;
function cal_prs_tsmp1 (str_datetime) {
if (!str_datetime)
return (new Date());
if (RE_NUM.exec(str_datetime))
return new Date(str_datetime);
var arr_datetime = str_datetime.split(' ');
return this.prs_time(arr_datetime[1], this.prs_date(arr_datetime[0]));
}
function cal_prs_date1 (str_date) {
var arr_date = str_date.split('-');
if (arr_date.length != 3) return cal_error ("Invalid date format: '" + str_date + "'.\nFormat accepted is dd-mm-yyyy.");
if (!arr_date[0]) return cal_error ("Invalid date format: '" + str_date + "'.\nNo day of month value can be found.");
if (!RE_NUM.exec(arr_date[0])) return cal_error ("Invalid day of month value: '" + arr_date[0] + "'.\nAllowed values are unsigned integers.");
if (!arr_date[1]) return cal_error ("Invalid date format: '" + str_date + "'.\nNo month value can be found.");
if (!RE_NUM.exec(arr_date[1])) return cal_error ("Invalid month value: '" + arr_date[1] + "'.\nAllowed values are unsigned integers.");
if (!arr_date[2]) return cal_error ("Invalid date format: '" + str_date + "'.\nNo year value can be found.");
if (!RE_NUM.exec(arr_date[2])) return cal_error ("Invalid year value: '" + arr_date[2] + "'.\nAllowed values are unsigned integers.");
var dt_date = new Date();
dt_date.setDate(1);
if (arr_date[1] < 1 || arr_date[1] > 12) return cal_error ("Invalid month value: '" + arr_date[1] + "'.\nAllowed range is 01-12.");
dt_date.setMonth(arr_date[1]-1);
var dt_numdays = new Date(arr_date[2], arr_date[1], 0);
dt_date.setDate(arr_date[0]);
if (dt_date.getMonth() != (arr_date[1]-1)) return cal_error ("Invalid day of month value: '" + arr_date[0] + "'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
var ARR_WEEKDAYS = ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"];
var NUM_WEEKSTART = 1;
var STR_ICONPATH = '../images/calendrier/img/';
var re_url = new RegExp('datetime=(\\-?\\d+)');
var dt_current = (re_url.exec(String(window.location))
? new Date(new Number(RegExp.$1)) : new Date());
var re_id = new RegExp('id=(\\d+)');
var num_id = (re_id.exec(String(window.location))
? new Number(RegExp.$1) : 0);
var obj_caller = (window.opener ? window.opener.calendars[num_id] : null);
if (obj_caller && obj_caller.year_scroll) {
var dt_prev_year = new Date(dt_current);
dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
if (dt_prev_year.getDate() != dt_current.getDate())
dt_prev_year.setDate(0);
var dt_next_year = new Date(dt_current);
dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
if (dt_next_year.getDate() != dt_current.getDate())
dt_next_year.setDate(0);
}
var dt_prev_month = new Date(dt_current);
dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
if (dt_prev_month.getDate() != dt_current.getDate())
dt_prev_month.setDate(0);
var dt_next_month = new Date(dt_current);
dt_next_month.setMonth(dt_next_month.getMonth() + 1);
if (dt_next_month.getDate() != dt_current.getDate())
dt_next_month.setDate(0);
var dt_firstday = new Date(dt_current);
dt_firstday.setDate(1);
dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
function set_datetime(n_datetime, b_close) {
if (!obj_caller) return;
var dt_datetime = obj_caller.prs_time(
(document.cal ? document.cal.time.value : ''),
new Date(n_datetime)
);
Si vous voulez vous pouvez essayer le calendrier de réservations en php que j'ai développé. On peut l'inclure gratuitement sur son site perso.
Pour cela, rendez-vous sur https://www.shared-house.com/ , créez un compte, une location et utilisez l'option "Webmaster". Vous pourrez alors copier/coller le code HTML proposé sur votre site perso et aurez ainsi un calendrier des réservations / disponibilités.
VOus pouvez insérer facilement un calendrier des réservations complet sur votre site en 2 minutes.
Si vous être propriétaire d'un site de locations de vacances, inscrivez vous gratuitement sur notre portail
https://www.chezvotrehote.fr/