Date of due

  • Nobody/Anonymous

    I would like to ask, is there any problem concerning sunday and saturday or public holiday?

    Out libaray count working day (Monday to Friday) only......I think there will be a problem, then what should we do?


    • Micah Stetson

      Micah Stetson - 2004-08-03

      I think the only way to address this directly would be to build a calendar into the program that staff could edit, and have the code consult the calendar when calculating due dates.  A simpler way might be to provide a mechanism for certain staff to edit the due dates of checkouts.

      There isn't code in there to do either of these things.  I'll probably do the second one for my clients sometime in the next year.  But don't hesitate to dive into the code yourself.


      • Nobody/Anonymous

        Hi !
        i Have modified the code for avoiding the saturday and sunday as due date. any date fall on saturday or sunday will automatically converted to upcomming monday ... follow the steps ..

        1. open /classes/iblioCopyQuery.php.
        2. find Function name function update($copy, $checkout=FALSE)

        3. Replace the Function with the Following Code ..

        function update($copy, $checkout=FALSE) {
            # checking for duplicate barcode number
            if (!$checkout) {
              $dupBarcode = $this->_dupBarcode($copy->getBarcodeNmbr(), $copy->getBibid(), $copy->getCopyid());
              if ($this->errorOccurred()) return false;
              if ($dupBarcode) {
                $this->_errorOccurred = true;
                $this->_error = $this->_loc->getText("biblioCopyQueryErr2",array("barcodeNmbr"=>$copy->getBarcodeNmbr()));
                return false;
            $sql = $this->mkSQL("update biblio_copy set "
                                . "status_cd=%Q, "
                                . "status_begin_dt=sysdate(), "
                                . "renewal_count=%N, ",

            if ($checkout){
              if ($copy->getDueBackDt() != "") {
                    # Patched on  21 Apr, 2008
                      $td = time();
                     $i = 1;
                        while ($i <= $j)
                            $td+= 86400; // Add a day.
                            } // while closed
                            $tempDate= getdate($td);
                            switch ($tempDate["wday"])
                            case 0:
                                     $td+= 86400;// due date on Sunday.. adding a day
                            case 6:
                                    $td+= 86400;
                                    $td+= 86400;// Due date on Saturday .. adding 2 days
                            }   // switch closes
                        $tDate = date('y-m-d',$td);
                           $sql .= $this->mkSQL("due_back_dt=date(%Q), ",$tDate);

              } else {
                $sql .= "due_back_dt=null, ";
              if ($copy->getMbrid() != "") {
                $sql .= $this->mkSQL("mbrid=%N, ", $copy->getMbrid());
              } else {
                $sql .= "mbrid=null, ";
            $sql .= $this->mkSQL("copy_desc=%Q, barcode_nmbr=%Q "
                                 . "where bibid=%N and copyid=%N",
                                 $copy->getCopyDesc(), $copy->getBarcodeNmbr(),
                                 $copy->getBibid(), $copy->getCopyid());
            return $this->_query($sql, $this->_loc->getText("biblioCopyQueryErr5"));

        Hope this will solve your Problem

        Junaid Iqbal.
        Karachi, Pakistan

        • Adam

          Adam - 2009-05-10

          Any ideas on how this could be modified to include referencing a MySQL table of dates that a library is closed rather than just Saturday or Sunday?

    • Nobody/Anonymous

      hahaha, I think edit the due dates of checkout when it comes to friday is the simplest way ^^
      thx anyway


    • Nobody/Anonymous

      in the previous messeage .. file is   BiblioCopyQuery.php

      Junaid Iqbal
      Karachi, Pakistan



Cancel  Add attachments