Jump to content

Search the Community

Showing results for tags 'calendar'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 3 results

  1. Hello W3S! I'm on it again.... (lol). So lately i've been playing around with creating my very own calendar system where i can connect everything with the database somehow (this is for future purposes tho! for now i only wonna make the calculations and the view/design look great!). So if you could help with the part of the calculations, i would love that. This is my (WHOLE) PHP/FILE code so far: (a little messy) <?php // -> Default Date, Time & Timezone Setup // Timezone List: ( " http://php.net/manual/en/timezones.php " ) date_default_timezone_set('Europe/Copenhagen'); // set the default timezone to use. Available since PHP 5.1 if( ini_get('date.timezone') != 'Europe/Copenhagen' ){ ini_set( 'date.timezone', 'Europe/Copenhagen' ); } // _GET the Year and Month // $m = "m" = "Numeric representation of a month, with leading zeros" = "01 through 12" // $m = "n" = "Numeric representation of a month, without leading zeros" = "1 through 12" $y = (isset($_GET['year']) ? $_GET['year'] : date('Y')); // Year $m = (isset($_GET['month']) ? $_GET['month'] : date('n')); // Month // Months (ARRAY) // ( just like Jan,Feb,Mar,Apr in short format etc... ) $months_array = array( '1'=>'Januar', // Januar (DK), Jan/JAN (DK/ENG), January (ENG) '2'=>'Februar', // Februar (DK), Feb/FEB (DK/ENG), February (ENG) '3'=>'Marts', // Marts (DK), Mar/MAR (DK/ENG), March (ENG) '4'=>'April', // April (DK), Apr/APR (DK/ENG), April (DK/ENG) '5'=>'Maj', // Maj (DK), Maj/MAJ (DK), May/MAY (ENG), May (ENG) '6'=>'Juni', // Juni (DK), Jun/JUN (DK/ENG), June (ENG) '7'=>'Juli', // Juli (DK), Jul/JUL (DK/ENG), July (ENG) '8'=>'August', // August (DK), Aug/AUG (DK/ENG), August (DK/ENG) '9'=>'September', // September (DK), Sep/SEP (DK/ENG), September (DK/ENG) '10'=>'Oktober', // Oktober (DK), Okt/OKT (DK), Oct/OCT (ENG), October (ENG) '11'=>'November', // November (DK), Nov/NOV (DK/ENG), November (DK/ENG) '12'=>'December' // December (DK), Dec/DEC (DK/ENG), December (DK/ENG) ); // Monthly Days (ARRAY) // ( md_array = Monthly Days _ Array ) $md_array = array( '1'=>31, // Jan '2'=>28, // Feb '3'=>31, // Mar '4'=>30, // Apr '5'=>31, // Maj '6'=>30, // Jun '7'=>31, // Jul '8'=>31, // Aug '9'=>30, // Sep '10'=>31, // Okt '11'=>30, // Nov '12'=>31 // Dec ); // Monthly Days (CALCULATION) // ( md = Monthly Days _ Calculation ) $md_calculation = ($m==2 && $y%4==0) ? 29 : $md_array[$m]; // (NEEDS MORE DETAILS FOR LATER PURPOSES!) // Days (ARRAY) $days_array = array( '1'=>'Mandag', // Mandag (DK), Man/MAN (DK), Mon/MON (ENG), Monday (ENG) '2'=>'Tirsdag', // Tirsdag (DK), Tir/TIR (DK), Tue/TUE (ENG), Tuesday (ENG) '3'=>'Onsdag', // Onsdag (DK), Ons/ONS (DK), Wed/WED (ENG), Wednesday (ENG) '4'=>'Torsdag', // Torsdag (DK), Tor/TOR (DK), Thu/THU (ENG), Thursday (ENG) '5'=>'Fredag', // Fredag (DK), Fre/FRE (DK), Fri/FRI (ENG), Friday (ENG) '6'=>'Lørdag', // Lørdag (DK), Lør/LØR (DK), Sat/SAT (ENG), Saturday (ENG) '7'=>'Søndag' // Søndag (DK), Søn/SØN (DK), Sun/SUN (ENG), Sunday (ENG) ); // Monthly Start Day (?) // ( msd_date = Monthly Start Day _ Date ) $msd_date = $y.'-'.$m.'-01'; // Monthly Start Day (?) // ( msd_startday = Monthly Start Day _ Start Day ) $msd_startday = array_search( date( 'D', strtotime($msd_date) ), $days_array ); // Next And Previous Calculation Of Month And Year (CALCULATION) // napcomay_next_y = Next And Previous Calculation Of Month And Year _ Next _ Year // napcomay_next_m = Next And Previous Calculation Of Month And Year _ Next _ Month // napcomay_prev_y = Next And Previous Calculation Of Month And Year _ Prev _ Year // napcomay_prev_m = Next And Previous Calculation Of Month And Year _ Prev _ Month $napcomay_next_y=(($m+1)>12)?($y+1):$y; $napcomay_next_m=(($m+1)>12)?1:($m+1); $napcomay_prev_y=(($m-1)<=0)?($y-1):$y; $napcomay_prev_m=(($m-1)<=0)?12:($m-1); ?> <!DOCTYPE html> <!-- da == (DANSK / DANISH) --> <html lang="da"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS - V.4.5.2 --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <!-- WWW TITLE --> <title>Kalender System - Version 1.0</title> </head> <body> <!-- DISPLAY YEARS AND YEAR PAGINATION --> <!-- display 5 previous and 5 next years of selected year --> <div class="container-fluid py-3"> <div class="row"> <div class="col-sm-12"> <nav> <ul class="pagination pagination-sm justify-content-center"> <!-- <li class="page-item"> <a class="page-link" href="#" aria-label="Previous"> <span aria-hidden="true">&laquo;</span> </a> </li> --> <?php for ($i=$y-5; $i<=$y+5; $i++){ $current_year = date("Y"); if( isset($_GET['year']) && $_GET['year'] == $i ) { echo ' <!-- <li class="page-item active" aria-current="page"> --> <li class="page-item active"> <span class="page-link"> '.$i.' <span class="sr-only">(nuværende år)</span> </span> </li> '; } else if( !isset($_GET['year']) && $i == $current_year ) { echo ' <!-- <li class="page-item active" aria-current="page"> --> <li class="page-item active"> <span class="page-link"> '.$i.' <span class="sr-only">(nuværende år)</span> </span> </li> '; } else { echo ' <li class="page-item"> <a class="page-link" href="index.php?year='.$i.'&month='.$m.'"> '.$i.' </a> </li> '; } } ?> <!-- <li class="page-item"> <a class="page-link" href="#" aria-label="Next"> <span aria-hidden="true">&raquo;</span> </a> </li> --> </ul> </nav> </div> </div> </div> <!-- DISPLAY MONTHS AND MONTHS PAGINATION --> <!-- display months --> <div class="container-fluid py-3"> <div class="row"> <div class="col-sm-12"> <nav> <ul class="pagination pagination-sm justify-content-center"> <!-- <li class="page-item"> <a class="page-link" href="#" aria-label="Previous"> <span aria-hidden="true">&laquo;</span> </a> </li> --> <?php foreach( $months_array AS $key => $value ){ echo ' <li class="page-item"> <a class="page-link" href="index.php?year='.$y.'&month='.$key.'"> '.$value.' </a> </li> '; } ?> <!-- <li class="page-item"> <a class="page-link" href="#" aria-label="Next"> <span aria-hidden="true">&raquo;</span> </a> </li> --> </ul> </nav> </div> </div> </div> <div class="container py-3"> <div class="row"> <div class="col-sm-12"> <header class="text-center"> <h1><?php echo $months_array[$m]; ?></h1> <h6>( <?php echo (isset($_GET['year']) ? $_GET['year'] : date("Y")); ?> )</h6> </header> </div> </div> <div class="row"> <div class="table-responsive"> <table class="table table-bordered table-striped table-hover"> <caption>TABLE CAPTION</caption> <thead> <tr class="text-center"> <!-- <th scope="col">UGE</th> <th scope="col">MAN</th> <th scope="col">TIR</th> <th scope="col">ONS</th> <th scope="col">TOR</th> <th scope="col">FRE</th> <th scope="col">LØR</th> <th scope="col">SØN</th> --> <th scope="col">UGE</th> <?php // display days foreach ( $days_array AS $key => $value ){ echo '<th scope="col">'.$value.'</th>'; } ?> </tr> </thead> <tbody> <!-- <tr> <th scope="row">1</th> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> <tr> <th scope="row">2</th> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> <tr> <th scope="row">3</th> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> <th scope="row">4</th> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> --> <tr> <?php for( $i=0; $i<($md_calculation+$msd_startday); $i++ ){ $day = ( $i - $msd_startday + 1 <= 9 ) ? '0'.( $i - $msd_startday + 1 ) : $i - $msd_startday + 1 ; echo ( $i < $msd_startday ) ? '<td></td>' : '<td>'.$day.'</td>' ; echo ( $i %7 == 0 ) ? '</tr><tr>' : '' ; } ?> </tr> </tbody> <tfoot> <tr class="text-center"> <td colspan="8">TABLE FOOT</td> </tr> </tfoot> </table> </div> </div> </div> <!-- Optional JavaScript --> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> </body> </html> Note that what im trying to do here, is to create a simple PHP Based Calendar dynamicly working. Right now im just trying to show some simple stuff so i know a little about how everything works. I watched this answer online: ( how-to-create-a-dynamic-calendar-with-mysql-php-etc ) - and it worked great! Then i started to tear stuff here and there apart, so i might understand it a little better and try to improve it a little bit. Now, i am showing in the HTML part successfully things like years, months... but the calendar itself i have a little trouble with. What i wanna try to do, is to also at one point, show stuff like (WEEKS)... and im talking weeks of the year here and what current week we are in. So that means in my code where i show the calendar, this code: for( $i=0; $i<($md_calculation+$msd_startday); $i++ ){ $day = ( $i - $msd_startday + 1 <= 9 ) ? '0'.( $i - $msd_startday + 1 ) : $i - $msd_startday + 1 ; echo ( $i < $msd_startday ) ? '<td></td>' : '<td>'.$day.'</td>' ; echo ( $i %7 == 0 ) ? '</tr><tr>' : '' ; } i have to somehow figure out how to calculate the weeks into the days, somehow giving the days an "offset" with "1" so that they do NOT overwrite somehow the weeks column in the HTML TABLE im creating the calendar on... i have tried to explain a little bit of what im trying and im still trying to figure out what everything means so that i can comment stuff out here and there for myself (for later purposes etc). So if you guys got any idea for the weeks/days part regarding the calendar, i would love the help i could get! ❤️ Thanks in advance NOTE: The full code i shared, you can copy/paste etc... its a full code with full design and everything based on bootstrap css library... just make sure to be online so it works If you got questions or i need to explain a little bit more into details, please reply and i will do my best. Thanks.
  2. Hello all, I'm trying to embed a public google calendar to my website using iframe, but this is not woorking in safari, chrome (private window) and i.e. The calendar is alrady set to public. This is the page: you can check it on multiple browsers. http://www.omcc03.net/testcinemanew/page.php?p=calendario How can I fix it? Thank you
  3. So I have a calendar that I created using JavaScript on an HTML page but now I need to create a variable that contains an array. The array needs to be a week long to-do list. Problem 1, I try to create the variable to produce the 'to-do' list but I'm not sure how to associate the array with a week out of the month. Second, I'm not sure where to plug in the variable once I have created it in order to make it show up in the calendar. Below is the script I wrote for the calendar. And help would be appreciated. Thanks! <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Month Calendar</title> </head> <body> <script> monthnames = new Array( "January", "Februrary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Decemeber"); var linkcount=0; function addlink(month, day, href) { var entry = new Array(3); entry[0] = month; entry[1] = day; entry[2] = href; this[linkcount++] = entry; } Array.prototype.addlink = addlink; linkdays = new Array(); monthdays = new Array(12); monthdays[0]=31; monthdays[1]=28; monthdays[2]=31; monthdays[3]=30; monthdays[4]=31; monthdays[5]=30; monthdays[6]=31; monthdays[7]=31; monthdays[8]=30; monthdays[9]=31; monthdays[10]=30; monthdays[11]=31; todayDate=new Date(); thisday=todayDate.getDay(); thismonth=todayDate.getMonth(); thisdate=todayDate.getDate(); thisyear=todayDate.getYear(); thisyear = thisyear % 100; thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear)); if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) ||(thisyear % 400 == 0)) monthdays[1]++; startspaces=thisdate; while (startspaces > 7) startspaces-=7; startspaces = thisday - startspaces + 1; if (startspaces < 0) startspaces+=7; document.write("<table border=2 bgcolor=white "); document.write("bordercolor=black><font color=black>"); document.write("<tr><td colspan=7><center><strong>" + monthnames[thismonth] + " " + thisyear + "</strong></center></font></td></tr>"); document.write("<tr>"); document.write("<td align=center>Su</td>"); document.write("<td align=center>M</td>"); document.write("<td align=center>Tu</td>"); document.write("<td align=center>W</td>"); document.write("<td align=center>Th</td>"); document.write("<td align=center>F</td>"); document.write("<td align=center>Sa</td>"); document.write("</tr>"); document.write("<tr>"); for (s=0;s<startspaces;s++) { document.write("<td> </td>"); } count=1; while (count <= monthdays[thismonth]) { for (b = startspaces;b<7;b++) { linktrue=false; document.write("<td>"); for (c=0;c<linkdays.length;c++) { if (linkdays[c] != null) { if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) { document.write("<a href="" + linkdays[c][2] + "">"); linktrue=true; } } } if (count==thisdate) { document.write("<font color='FF0000'><strong>"); } if (count <= monthdays[thismonth]) { document.write(count); } else { document.write(" "); } if (count==thisdate) { document.write("</strong></font>"); } if (linktrue) document.write("</a>"); document.write("</td>"); count++; } document.write("</tr>"); document.write("<tr>"); startspaces=0; } document.write("</table></p>"); </script> </body> </html>
×
×
  • Create New...