Code Search for Developers
 
 
  

multiple-dates.html from Group-Office groupware at Krugle


Show multiple-dates.html syntax highlighted

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Sample for the multiple dates feature</title>
  <!-- calendar stylesheet -->
  <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-cold-1.css" title="win2k-cold-1" />

  <!-- main calendar program -->
  <script type="text/javascript" src="calendar.js"></script>

  <!-- language for the calendar -->
  <script type="text/javascript" src="lang/calendar-en.js"></script>

  <!-- the following script defines the Calendar.setup helper function, which makes
       adding a calendar a matter of 1 or 2 lines of code. -->
  <script type="text/javascript" src="calendar-setup.js"></script>
</head>

<body>
  <h1>Sample for the multiple dates feature</h1>

  <p>
    Starting version 0.9.7,
    the calendar is able to handle multiple dates selection, in either
    flat or popup form.  For this to happen one needs to pass the
    "<tt>multiple:&nbsp;true</tt>" parameter to
    <tt>Calendar.setup</tt> and to install an <tt>onUpdate</tt>
    handler that watches for modifications.
  </p>

  <a id="trigger" href="#">[open calendar...]</a>

  <div id="output"></div>

  <script type="text/javascript">//<![CDATA[
    // the default multiple dates selected, first time the calendar is instantiated
    var MA = [];

    function closed(cal) {

      // here we'll write the output; this is only for example.  You
      // will normally fill an input field or something with the dates.
      var el = document.getElementById("output");

      // reset initial content.
      el.innerHTML = "";

      // Reset the "MA", in case one triggers the calendar again.
      // CAREFUL!  You don't want to do "MA = [];".  We need to modify
      // the value of the current array, instead of creating a new one.
      // Calendar.setup is called only once! :-)  So be careful.
      MA.length = 0;

      // walk the calendar's multiple dates selection hash
      for (var i in cal.multiple) {
        var d = cal.multiple[i];
        // sometimes the date is not actually selected, that's why we need to check.
        if (d) {
          // OK, selected.  Fill an input field.  Or something.  Just for example,
          // we will display all selected dates in the element having the id "output".
          el.innerHTML += d.print("%A, %Y %B %d") + "<br />";

          // and push it in the "MA", in case one triggers the calendar again.
          MA[MA.length] = d;
        }
      }
      cal.hide();
      return true;
    };

    Calendar.setup({
      align      : "BR",
      showOthers : true,
      multiple   : MA, // pass the initial or computed array of multiple dates to be initially selected
      onClose    : closed,
      button     : "trigger"
    });
  //]]></script>

<hr />
<address><a href="http://dynarch.com/mishoo/">mishoo</a></address>
<!-- hhmts start --> Last modified: Thu Mar  3 20:17:42 EET 2005 <!-- hhmts end -->
</body> </html>




See more files for this project here

Group-Office groupware

Group-Office is a powerfull modular Internet/Intranet application framework. It features calendaring, project management, e-mail, tasks, addressbook, file management.

Project homepage: http://sourceforge.net/projects/group-office
Programming language(s): JavaScript,Pascal,PHP
License: other

  doc/
    html/
      field-button.jpg
      reference-Z-S.css
      reference.css
      reference.html
    reference.pdf
  lang/
    b5.js
    calendar-af.js
    calendar-al.js
    calendar-bg.js
    calendar-big5-utf8.js
    calendar-big5.js
    calendar-br.js
    calendar-ca.js
    calendar-cs-utf8.js
    calendar-cs-win.js
    calendar-cs.js
    calendar-da.js
    calendar-de.js
    calendar-du.js
    calendar-el.js
    calendar-en.js
    calendar-es.js
    calendar-fi.js
    calendar-fr.js
    calendar-he-utf8.js
    calendar-hr-utf8.js
    calendar-hr.js
    calendar-hu.js
    calendar-it.js
    calendar-ja.js
    calendar-jp.js
    calendar-ko-utf8.js
    calendar-ko.js
    calendar-lang.php
    calendar-lt-utf8.js
    calendar-lt.js
    calendar-lv.js
    calendar-nl.js
    calendar-no.js
    calendar-pl-utf8.js
    calendar-pl.js
    calendar-pt-br.js
    calendar-pt.js
    calendar-ro.js
    calendar-ru.js
    calendar-ru_win_.js
    calendar-si.js
    calendar-sk.js
    calendar-sl.js
    calendar-sp.js
    calendar-sv.js
    calendar-th.js
    calendar-tr.js
    calendar-zh-tw.js
    calendar-zh.js
    cn_utf8.js
  ChangeLog
  README
  bugtest-hidden-selects.html
  calendar-blue.css
  calendar-blue2.css
  calendar-brown.css
  calendar-go.css
  calendar-green.css
  calendar-lang.php
  calendar-setup.js
  calendar-setup_stripped.js
  calendar-system.css
  calendar-tas.css
  calendar-win2k-1.css
  calendar-win2k-2.css
  calendar-win2k-cold-1.css
  calendar-win2k-cold-2.css
  calendar.js
  calendar.php
  calendar_stripped.js
  dayinfo.html
  img.gif
  index.html
  menuarrow.gif
  menuarrow2.gif
  multiple-dates.html
  release-notes.html
  simple-1.html
  simple-2.html
  simple-3.html
  simple-4.html
  test-position.html
  test.php