Calendrier d?une année entiere en coldfusion

fionalabelle Messages postés 14 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 25 août 2006 - 23 août 2006 à 12:45
cs_bellamy Messages postés 21 Date d'inscription dimanche 26 février 2006 Statut Membre Dernière intervention 29 février 2008 - 25 août 2006 à 18:59
Bonjour à tous,

Quelqu'un peut-il me dire comment changer le code suivant que j'ai trouvé sur ce forum pour obtenir le calendrier d'une année entiere. Ou alors quelqu'un a t?il un code en coldfusion qui gere le calendrier d'une année entiere ?

Merci d'avance pour votre aide

FL

 <cfset title="-[ Calendar ]-"><!--- Texte du titre --->
<cfset BgColor="64aaDC"><!--- Couleur de fond de page --->
<cfset bgcarac="aaa4DC"><!--- Couleur de fond de page --->
<cfset BgMenu="64aaDC"><!--- Couleur de fond pour la selection du mois et de l annee --->
<cfset BgDayAlpha="0066aa"><!--- Couleur de fond des jours en lettre --->
<cfset BgDayNumb="CCCCCC"><!--- Couleur de fond des jours en chiffre --->
<cfset WCase="30"><!--- Largeur de la case --->
<cfset HCase="30"><!--- Hauteur de la case --->

<cfparam name="dateOnClick" default="#Now()#"><!--- Date du jour, elle sera utiliser pour faire des calculs --->
<cfparam name="Currentdate" default="#Now()#"><!--- Date du jour --->
<cfset Jour=0>
<cfset Mois=#Month(Currentdate)#><!--- Le mois de la date du jour --->
<cfset Annee=#Year(Currentdate)#><!--- Le annee de la date du jour --->
<cfset J1=DayofWeek("#Month(dateOnClick)#/01/#Year(dateOnClick)#")>
<cfset NBJ=DaysInMonth(dateOnClick)> <!--- Nombre de Jour --->

<cfoutput>
<html>
<head>
  <title>#title#</title>
  <style>
    A:visited    { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:hover      { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:link       { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:active     { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday  { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:visited { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:hover   { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:link    { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:active  { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .content     { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
  </style>
  <script>
  function dayClick() {
    alert('#month(dateOnClick)#-#Jour#-#year(dateOnClick)#');
  }
  </script>
</head>


<table width="100%" border="0" cellpadding="0" cellspacing="0" class="content" bgcolor="#BgMenu#">
----, <<</td>
#MonthasString(Month(dateOnClick))#,
>>,
,
<<,
#Year(dateOnClick)#,
>>

    </td>
  </tr>
  <tr>
    <td>
      Su,
Mo,
Tu,
We,
Th,
Fr,
Sa,

<cfloop index=\"j\" from=\"1\" to=\"6\" step=\"1\">
----

<cfloop index=\"i\" from=\"1\" to=\"7\" step=\"1\">
<cfif (i eq J1) and (j eq 1) or (Jour GTE 1) and (Jour LT NbJ)>
<cfset Jour=Jour+1>
<cfif (Jour EQ Day(dateOnClick)) and (Mois EQ month(dateOnClick)) and (Annee EQ year(dateOnClick))>
#Jour#
<cfelse>
#Jour#
</cfif>
<cfelse>

</cfif>,
</cfloop>

</cfloop>

    </td>
  </tr>
</table>


</html>
</cfoutput>

6 réponses

syndrael Messages postés 2378 Date d'inscription lundi 4 février 2002 Statut Membre Dernière intervention 29 décembre 2012 20
23 août 2006 à 13:31
Tu n'avais pas déja posé la même question il y a qqs mois ??

Cordialement.

S.
0
fionalabelle Messages postés 14 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 25 août 2006
23 août 2006 à 14:23
Salut Syndrael,

non ce n'etait pas la meme question.
J'arrive bien à changer le code et j'obtient le calendrier des mois oaût, septembre, oktobre, novembre et dezembre.
Mais j'ai un proleme avec les mois qui sont dejà passés comme janvier jusqu'a Juillet.
Comment faire celà?

Merci
0
cs_bellamy Messages postés 21 Date d'inscription dimanche 26 février 2006 Statut Membre Dernière intervention 29 février 2008
24 août 2006 à 12:26
Salut,
Tu peux réexpliquer STP ton probléme, car le calendrier fonctionne bien.
Merci.
0
fionalabelle Messages postés 14 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 25 août 2006
25 août 2006 à 12:03
Salut bellamy,

oui le calendrier fonctionne bien. Mais je veux afficher sur une page le canlendrier avec les douzes mois de l'année 2006. C-a-d de janvier à decembre 2006. Quand je le fait, il m'affiche le calendrier 2006 et 2007 avec les mois d'oûat 2006 à janvier 2007. Mais je voulais plutôt que les mois de janvier à decembre 2006 soient affichés.

Merci

FL
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
titiscan Messages postés 4 Date d'inscription mercredi 5 mars 2003 Statut Membre Dernière intervention 23 juillet 2008
25 août 2006 à 18:09
salut, c'est ca qu'il te faut ?
y'a surement moyen d'optimiser un peu et j'ai pas enlevé les changements de mois devenu inutile....


<cfset title="-[ Calendar ]-"><!--- Texte du titre --->
<cfset BgColor="64aaDC"><!--- Couleur de fond de page --->
<cfset bgcarac="aaa4DC"><!--- Couleur de fond de page --->
<cfset BgMenu="64aaDC"><!--- Couleur de fond pour la selection du mois et de l annee --->
<cfset BgDayAlpha="0066aa"><!--- Couleur de fond des jours en lettre --->
<cfset BgDayNumb="CCCCCC"><!--- Couleur de fond des jours en chiffre --->
<cfset WCase="30"><!--- Largeur de la case --->
<cfset HCase="30"><!--- Hauteur de la case --->

<cfparam name="dateOnClick" default="#Now()#"><!--- Date du jour, elle sera utiliser pour faire des calculs --->
<cfparam name="Currentdate" default="#Now()#"><!--- Date du jour --->

<cfset Jour=0>
<!--- 
<cfset Mois=#Month(Currentdate)#><!--- Le mois de la date du jour --->
<cfset Annee=#Year(Currentdate)#><!--- Le annee de la date du jour --->
<cfset J1=DayofWeek("#Month(dateOnClick)#/01/#Year(dateOnClick)#")>
<cfset NBJ=DaysInMonth(dateOnClick)> <!--- Nombre de Jour --->
 --->
<cfoutput>
<html>
<head>
  <title>#title#</title>
  <style>
    A:visited    { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:hover      { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:link       { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:active     { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday  { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:visited { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:hover   { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:link    { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:active  { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .content     { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
  </style>
  <script>
  function dayClick() {
    alert('#month(dateOnClick)#-#Jour#-#year(dateOnClick)#');
  }
  </script>
</head>

    ----

       
<cfloop from=\"1\" to=\"12\" index=\"imois\">

    <cfset dateOnClick=createdate(year(dateOnClick),imois,1)>
    <cfset Jour=0>
    <cfset Mois=#Month(Currentdate)#><!--- Le mois de la date du jour --->
    <cfset Annee=#Year(Currentdate)#><!--- Le annee de la date du jour --->
    <cfset J1=DayofWeek(\"#Month(dateOnClick)#/01/#Year(dateOnClick)#\")>
    <cfset NBJ=DaysInMonth(dateOnClick)> <!--- Nombre de Jour --->
        <table border="0" cellspacing="0" cellpadding="0" align="center" >
----

   ,
      <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"content\" bgcolor=\"#BgMenu#\">
        ----

          &amp;lt;&amp;lt;,
          #MonthasString(Month(dateOnClick))#,
          &amp;gt;&amp;gt;,
          &amp;nbsp;,
          &amp;lt;&amp;lt;,
          #Year(dateOnClick)#,
          &amp;gt;&amp;gt;,
       
     

    </td>
  </tr>
  <tr>
    <td>
              ----

          Su,
          Mo,
          Tu,
          We,
          Th,
          Fr,
          Sa,
       
        <cfloop index=\"j\" from=\"1\" to=\"6\" step=\"1\">
        ----

          <cfloop index=\"i\" from=\"1\" to=\"7\" step=\"1\">
                          <cfif (i eq J1) and (j eq 1) or (Jour GTE 1) and (Jour LT NbJ)>
                <cfset Jour=Jour+1>
                <cfif (Jour EQ Day(dateOnClick)) and (Mois EQ month(dateOnClick)) and (Annee EQ year(dateOnClick))>
                  #Jour#
                <cfelse>
                  #Jour#
                </cfif>
              <cfelse>
                &amp;nbsp;
              </cfif>
           ,  
          </cfloop>
       
        </cfloop>
     

    </td>
  </tr>
</table> 
        </td>
    <cfif not imois mod 4></tr><tr></cfif>

</cfloop>
</tr>
</table>

</html>
</cfoutput>

0
cs_bellamy Messages postés 21 Date d'inscription dimanche 26 février 2006 Statut Membre Dernière intervention 29 février 2008
25 août 2006 à 18:59
salut,
Autre manière de faire,

<cfset title="-[ Calendar ]-"><!--- Texte du titre --->
<cfset BgColor="64aaDC"><!--- Couleur de fond de page --->
<cfset bgcarac="aaa4DC"><!--- Couleur de fond de page --->
<cfset BgMenu="64aaDC"><!--- Couleur de fond pour la selection du mois et de l annee --->
<cfset BgDayAlpha="0066aa"><!--- Couleur de fond des jours en lettre --->
<cfset BgDayNumb="CCCCCC"><!--- Couleur de fond des jours en chiffre --->
<cfset WCase="30"><!--- Largeur de la case --->
<cfset HCase="30"><!--- Hauteur de la case --->

<cfloop index="ind" from="1" to="12" step="1">
<cfparam name="dateOnClick" default="#Now()#"><!--- Date du jour, elle sera utiliser pour faire des calculs --->
<cfparam name="Currentdate" default="#Now()#"><!--- Date du jour --->
<cfset Jour=0>
<cfset dateOnClick=#Dateadd('m',-#Month(dateOnClick)#+#ind#, dateOnClick)#>
<cfset Mois=#Month(Currentdate)#><!--- Le mois de la date du jour --->
<cfset Annee=#Year(Currentdate)#><!--- Le annee de la date du jour --->
<cfset J1=DayofWeek("#Month(dateOnClick)#/01/#Year(dateOnClick)#")>

<cfset NBJ=DaysInMonth(dateOnClick)> <!--- Nombre de Jour --->

<cfoutput>
<html>
<head>
  <title>#title#</title>
  <style>
    A:visited    { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:hover      { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:link       { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    A:active     { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday  { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:visited { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:hover   { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:link    { color: FF0000; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .currentday:active  { color: 33AA55; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
    .content     { color: FFFFFF; font-size: 9pt; font-family: Verdana; font-weight : bold; text-decoration: none }
  </style>
  <script>
  function dayClick() {
    alert('#month(dateOnClick)#-#Jour#-#year(dateOnClick)#');
  }
  </script>
</head>

          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="content" bgcolor="#BgMenu#">
        ----

         , &amp;lt;&amp;lt;</td>
          #MonthasString(Month(dateOnClick))#,
          &amp;gt;&amp;gt;,
          &amp;nbsp;,
          &amp;lt;&amp;lt;,
          #Year(dateOnClick)#,
          &amp;gt;&amp;gt;,
       
     

    </td>
  </tr>
  <tr>
    <td>
              ----

          Di,
          Lu,
          Ma,
          Me,
          Je,
          Ve,
          Sa,
       
        <cfloop index=\"j\" from=\"1\" to=\"6\" step=\"1\">
        ----

        <cfset BgDayNumb=\"aaaaaa\">
          <cfloop index=\"i\" from=\"1\" to=\"7\" step=\"1\">
     
                          <cfif (i eq J1) and (j eq 1) or (Jour GTE 1) and (Jour LT NbJ)>
                <cfset Jour=Jour+1>
                <cfif (Jour EQ Day(dateOnClick)) and (Mois EQ month(dateOnClick)) and (Annee EQ year(dateOnClick))>
                  #Jour#
                <cfelse>
                  #Jour#
                </cfif>
              <cfelse>
                &amp;nbsp;
              </cfif>
           ,
   <cfset BgDayNumb=\"cccccc\">
          </cfloop>
       
        </cfloop>
     

    </td>
  </tr>
</table>

</html>
</cfoutput>
</cfloop>

0
Rejoignez-nous