Exemplo n.º 1
0
        /**
         * Creates a new date formatter with the given specification.
         *
         * @param format The format.
         */
        public CellDateFormatter(String format)
            : base(format)
        {
            DatePartHandler partHandler = new DatePartHandler(this);
            StringBuilder   descBuf     = CellFormatPart.ParseFormat(format,
                                                                     CellFormatType.DATE, partHandler);

            partHandler.Finish(descBuf);
            dateFmt = new SimpleDateFormat(descBuf.ToString());
        }
Exemplo n.º 2
0
        /**
         * Creates a new date formatter with the given specification.
         *
         * @param format The format.
         */
        public CellDateFormatter(String format)
            : base(format)
        {
            DatePartHandler partHandler = new DatePartHandler(this);
            StringBuilder   descBuf     = CellFormatPart.ParseFormat(format,
                                                                     CellFormatType.DATE, partHandler);

            partHandler.Finish(descBuf);
            dateFmt = new SimpleDateFormat(descBuf.ToString());

            //NPOI do not need this
            // tweak the format pattern to pass tests on JDK 1.7,
            // See https://issues.apache.org/bugzilla/show_bug.cgi?id=53369
            //String ptrn = descBuf.toString().replaceAll("((y)(?!y))(?<!yy)", "yy");
            //dateFmt = new SimpleDateFormat(ptrn, LOCALE);
        }
Exemplo n.º 3
0
 /**
  * Creates a new date formatter with the given specification.
  *
  * @param format The format.
  */
 public CellDateFormatter(String format)
     : base(format)
 {
     DatePartHandler partHandler = new DatePartHandler(this);
     StringBuilder descBuf = CellFormatPart.ParseFormat(format,
             CellFormatType.DATE, partHandler);
     partHandler.Finish(descBuf);
     dateFmt = new SimpleDateFormat(descBuf.ToString());
 }
Exemplo n.º 4
0
 /**
  * Creates a new date formatter with the given specification.
  *
  * @param format The format.
  */
 public CellDateFormatter(String format)
     : base(format)
 {
     DatePartHandler partHandler = new DatePartHandler(this);
     StringBuilder descBuf = CellFormatPart.ParseFormat(format,
             CellFormatType.DATE, partHandler);
     partHandler.Finish(descBuf);
     dateFmt = new SimpleDateFormat(descBuf.ToString());
     
     //NPOI do not need this
     // tweak the format pattern to pass tests on JDK 1.7,
     // See https://issues.apache.org/bugzilla/show_bug.cgi?id=53369
     //String ptrn = descBuf.toString().replaceAll("((y)(?!y))(?<!yy)", "yy");
     //dateFmt = new SimpleDateFormat(ptrn, LOCALE);
 }