Calendrier personnalisé

tiaff Messages postés 54 Statut Membre -  
tiaff Messages postés 54 Statut Membre -
Bonjour,

Bonjour à tous,
J'ai besoin de votre aide pour la création d'un calendrier personnalisé (ex :
http://www.materneo.com/grossesse/grossesse-au-quotidien/calcul-date-grossesse-calendrier/calc266.html . Un calendrier qui calcule des dates clés avec intervalles variés ( ex : + une semaine, + un mois, + un trimestre ...) à partir d'une date qu'on fourni.
Merci de me renseigner s'il existe un lien pour la réalisation du projet.
En vous remerciant



--
What else!!!

2 réponses

  1. Floriancake Messages postés 17 Statut Membre
     
    Tu peux le faire sur Internet ?
    0
  2. tiaff Messages postés 54 Statut Membre 7
     
    bonjour.
    voila un essai
    http://www.studionord.fr/calendrier-personnalise/calendrier-perso.html

    mais il manque quelque chose car le calcul ne fonctionne pas.

    pouvez-vous m aider svp.

    merci par avance

    <html>    
    <head>    
    <script language="javascript" type="text/javascript">    
    
    function calculate() {    
    var DAY = 86400000;    
    var WEEK = 604800000;    
    var dat1 = new Date(parseInt(document.f.year.options[document.f.year.selectedIndex].text), document.f.month.selectedIndex, parseInt(document.f.day.options[document.f.day.selectedIndex].text), 18, 0, 0);    
    var days = new Array("Dim.", "Lun.", "Mar.", "Mer.", "Jeu.", "Ven.", "Sam.");    
    var mnths = new Array("Jan", "Fev", "Mar", "Avr", "Mai", "Juin", "Juillet", "Aout", "Sept", "Oct", "Nov", "Dec");    
    var tester = 1;    
    var dys = Math.round(document.f.txtdays.value);    
    if (dys > 100 || dys < 5) {    
    alert("The value entered for time between cycles is extreme. \nThis calculator will use values between 5 and 100 days");    
    tester = 2;    
    }    
    if (tester == 1) {    
    var expiry = new Date;    
    expiry.setTime(expiry.getTime() + 25920000000);    
    document.cookie = "DateData=" + document.f.txtdays.value + "|" + document.f.day.selectedIndex + "|" + document.f.month.selectedIndex + "|" + document.f.year.selectedIndex + "|" + document.f.dayofweek.selectedIndex + "|" + ";" + "expires=" + expiry.toGMTString() + ";";    
    }    
    document.f2.T1.value = days[dat1.getDay()] + " " + dat1.getDate() + " " + mnths[dat1.getMonth()] + " " + getFullYear(dat1);    
    if (dys > 28) {    
    newdat1 = dat1.getTime() + DAY * Math.round(dys * 0.85 * 0.6666666666666666);    
    dat1.setTime(newdat1);    
    document.f2.T3.value = days[dat1.getDay()] + " " + dat1.getDate() + " " + mnths[dat1.getMonth()] + " " + getFullYear(dat1);    
    }    
    if (dys < 29) {    
    newdat1 = dat1.getTime() + DAY * (dys / 2);    
    dat1.setTime(newdat1);    
    document.f2.T3.value = days[dat1.getDay()] + " " + dat1.getDate() + " " + mnths[dat1.getMonth()] + " " + getFullYear(dat1);    
    }    
    for (var i = 4; i < 42; i++) {    
    newdat1 = dat1.getTime() + WEEK * 1;    
    dat1.setTime(newdat1);    
    eval("document.f2.T" + i + ".value = days[dat1.getDay()] + \" \" + dat1.getDate() + \" \" + mnths[dat1.getMonth()] + \" \" + getFullYear(dat1)");    
    }    
    } /* !eval(new String("document.f2.T" + i + ".value = days[dat1.getDay();)) */    
    
    
    </script>    
    
    <title>Calendrier de grossesse</title>    
    <body>    
    
    <table style="width: 100%;" border="0" cellspacing="6" cellpadding="0">    
    <tbody>    
    <tr>    
    <td style="text-align: left;" width="54%">    
    <form name="f">    
    <strong><span style="color: #cc0000;">* 1ère étape :</span></strong> Entrez la date du <span style="color: #ff6600;">premier</span> jour de vos dernières règles<br /><br /> <br /> <select name="month" size="1" onchange="changeDays(0,this.form)"> <option>Janvier </option><option>Février </option><option>Mars </option><option selected="selected">Avril </option><option>Mai </option><option>Juin </option><option>Juillet </option><option>Aout </option><option>Sept </option><option>Octobre </option><option>Novembre </option><option>Decembre </option></select>     <select name="day" size="1" onchange="changeDays(1,this.form)"> <option selected="selected">1 </option><option>2 </option><option>3 </option><option>4 </option><option>5 </option><option>6 </option><option>7 </option><option>8 </option><option>9 </option><option>10 </option><option>11 </option><option>12 </option><option>13 </option><option>14 </option><option>15 </option><option>16 </option><option>17 </option><option>18 </option><option>19 </option><option>20 </option><option>21 </option><option>22 </option><option>23 </option><option>24 </option><option>25 </option><option>26 </option><option>27 </option><option>28 </option><option>29 </option><option>30 </option><option>31 </option></select>     <select name="year" size="1" onchange="changeDays(0,this.form)"> <option>2011 </option><option selected="selected">2012 </option><option>2013 </option><option>2014 </option><option>2015 </option><option>2016 </option><option>2017 </option><option>2018 </option><option>2019 </option></select>              
    <p style="margin-top: 0; margin-bottom: 0;" align="left"><br /> Ce jour était un <select name="dayofweek" size="1"> <option>Dimanche </option><option>Lundi </option><option>Mardi </option><option>Mercredi </option><option>Jeudi </option><option>Vendredi </option><option>Samedi </option></select> <br /> <br /><br />    
    
    <strong><span style="color: #cc0000;">* 2ème étape :</span></strong> Inscrivez la durée approximative de votre cycle (en nombre de jours)<br /> </p>    
    <p style="margin-top: 0; margin-bottom: 0;">Nombre de jours = <input type="text" name="txtdays" value="28" size="1" /></p>    
    <p style="margin-top: 0; margin-bottom: 0;" align="left"><br /><br />    
    
    <strong><span style="color: #cc0000;">* 3ème étape :  </span></strong>    <input onclick="calculate()" type="button" name="btn1" value="Calculez!" align="absmiddle" /></p>    
    </form></td></tr>    
    </tbody>    
    </table>    
    
    <form name="f2">    
    <p style="margin: 0;"><br /><br /><strong><span style="color: #3366ff;">* Votre grossesse d'après les informations et dates que vous avez rentré dans le moteur de calcul :</span></strong><br /> </p>    
    <table style="width: 90%;" border="0" cellspacing="6" cellpadding="0">    
    <tbody>    
    <tr>    
    <td style="text-align: left;" width="59%"><span style="margin: 0;"><strong><span style="color: #cc0000;">*</span></strong> Le premier jour de vos dernières règles était le </span></td>    
    <td width="41%"><span style="margin: 0;"> <input type="text" name="T1" size="20"  value=""/> </span></td>    
    </tr>    
    <tr>    
    <td style="text-align: left;"><span style="margin: 0;"><strong><span style="color: #cc0000;">*</span></strong> La date de la conception estimée est le </span></td>    
    <td><span style="margin: 0;"> <input type="text" name="T3" size="20" /></span></td>    
    </tr>    
    <tr>    
    <td style="text-align: left;"><strong><span style="color: #cc0000;">*</span></strong> Date à laquelle vos règles auraient pu revenir ...</td>    
    <td width="20"><input type="text" name="T5" size="20" /></td>    
    </tr>    
    <tr>    
    <td style="text-align: left;"><span style="margin: 0;"><strong><span style="color: #cc0000;">*</span></strong> Vous pouvez faire votre test de grossesse à partir du </span></td>    
    <td><span style="margin: 0;"> <input type="text" name="T6" size="20" /></span></td>    
    </tr>    
    <tr>    
    <td style="text-align: left;"><span style="margin: 0;"><strong><span style="color: #cc0000;">*</span></strong> Votre bébé sera dans vos bras vers le </span></td>    
    <td><span style="margin: 0;"> <input type="text" name="T41" size="20" /></span></td>    
    </tr>    
    </tbody>    
    </table>    
    
    </form>    
    
    <script type="text/javascript">// <![CDATA[    
    //Added for COOKIES    
    if (document.cookie) {    
     var cookiestuff = document.cookie;    
     var userdatedata = cookiestuff.split("=");    
      if (userdatedata[0] == "DateData"){    
       var ddmy=userdatedata[1].split("|");    
       document.f.txtdays.value=ddmy[0];    
       document.f.day.selectedIndex=ddmy[1];    
       document.f.month.selectedIndex=ddmy[2];    
       document.f.year.selectedIndex=ddmy[3];    
       document.f.dayofweek.selectedIndex=ddmy[4];    
       calculate();    
      }    
    }    
    // ]]></script>    
    
    </body>    
    </head>    
    </html>   
    0