DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7119>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7119

[PATCH] org.apache.poi.hssf.usermodel.HSSFCell#setCellValue(Calendar value)

           Summary: [PATCH]
                    org.apache.poi.hssf.usermodel.HSSFCell#setCellValue(Cale
                    ndar value)
           Product: POI
           Version: 2.0-dev
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


--- HSSFCell.java       Wed Mar 13 17:53:21 2002
+++ HSSFCellNew.java    Wed Mar 13 17:53:02 2002
@@ -72,6 +72,7 @@
 import org.apache.poi.hssf.record.ExtendedFormatRecord;

 import java.util.Date;
+import java.util.Calendar;

 /**
  * High level representation of a cell in a row of a spreadsheet.
@@ -631,6 +632,19 @@
     public void setCellValue(Date value)
     {
         setCellValue(HSSFDateUtil.getExcelDate(value));
+    }
+
+    /**
+     * set a date value for the cell. Excel treats dates as numeric so you
will need to format the cell as
+     * a date.
+     *
+     * @param value  the date value to set this cell to.  For formulas
we'll set the
+     *        precalculated value, for numerics we'll set its value. For
othertypes we
+     *        will change the cell to a numeric cell and set its value.
+     */
+    public void setCellValue(Calendar value)
+    {
+        setCellValue(value.getTime());
     }

     /**

Reply via email to