Package com.google.gwt.visualization.client.formatters.DateFormat

Examples of com.google.gwt.visualization.client.formatters.DateFormat.Options


        // Verify that explicitly setting the formatted value overrides the default
        // date.
        assertEquals("30/01/2009, 8:00", dataTable.getFormattedValue(3, 2));

        // Test date formatting using formatType and a timezone.
        Options options;
       
        options = Options.create();
        options.setPattern(FormatType.LONG);
        options.setTimeZone(2);
        DateFormat formatter = DateFormat.create(options);
        formatter.format(dataTable, 1);
        formatter.format(dataTable, 2);
        assertEquals("March 11, 2005", dataTable.getFormattedValue(0, 1));
        assertEquals("February 16, 2009 1:00:00 PM UTC+2",
                     dataTable.getFormattedValue(0, 2));
        // Verify that using a formatter on a column overrides all previously set
        // formatted-values.
        assertEquals("January 30, 2009 10:00:00 AM UTC+2",
                     dataTable.getFormattedValue(3, 2));

        // Test formatting date using pattern and timezone.
       
        options = Options.create();
        options.setPattern("dd/MM/yyyy");
        options.setTimeZone(2);
        formatter = DateFormat.create(options);
        formatter.format(dataTable, 1);
        assertEquals("11/03/2005", dataTable.getFormattedValue(0, 1));
        options = Options.create();
        options.setPattern("dd/MM/yyyy, HH:mm");
        options.setTimeZone(2);
        formatter = DateFormat.create(options);
        formatter.format(dataTable, 2);
        assertEquals("16/02/2009, 13:00", dataTable.getFormattedValue(0, 2));
      }
    });
View Full Code Here

TOP

Related Classes of com.google.gwt.visualization.client.formatters.DateFormat.Options

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.