Examples of DateTimeFormat


Examples of com.google.gwt.i18n.client.DateTimeFormat

            canvas.setStrokeStyle(gridColor);
            canvas.setLineWidth(0.8);
            canvas.beginPath();
        }

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d y");
        while (monday.before(currentEndDate)) {
            Label lbl = new Label();
            lbl.setWidth(width + "px");
            lbl.setStyleName(CLASSNAME_SCALEDATE);
            lbl.setText(formatter.format(monday));
            timeFromStart = monday.getTime() - currentStartDate.getTime();
            float x = timeFromStart * xUnit + paddingLeft;

            canvas.moveTo(x, 0);
            canvas.lineTo(x, canvas.getHeight());
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat

            canvas.setStrokeStyle(gridColor);
            canvas.setLineWidth(0.8);
            canvas.beginPath();
        }

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM y");
        int currentMonth = currentStartDate.getMonth();
        int currentYear = currentStartDate.getYear();
        Float width = VTimelineWidget.getDaysInMonth(currentMonth, currentYear)
        * DAY * xUnit;
        while (first.before(currentEndDate)) {
            Label lbl = new Label();
            lbl.setStyleName(CLASSNAME_SCALEDATE);
            lbl.setWidth(width + "px");
            lbl.setText(formatter.format(first));

            timeFromStart = first.getTime() - currentStartDate.getTime();
            float x = timeFromStart * xUnit + paddingLeft;

            if (gridColor != null) {
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat

            canvas.setStrokeStyle(gridColor);
            canvas.setLineWidth(0.8);
            canvas.beginPath();
        }

        DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy");
        while (first.before(currentEndDate)) {
            Label lbl = new Label();
            lbl.setWidth(width + "px");
            lbl.setText(formatter.format(first));
            lbl.setStyleName(CLASSNAME_SCALEDATE);

            timeFromStart = first.getTime() - currentStartDate.getTime();
            float x = timeFromStart * xUnit + paddingLeft;

View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat

            displayComponentPanel.add(lbl);
            displayComponentPanel.setWidgetPosition(lbl, (int)x-lbl.getOffsetWidth()/2, (int)y-lbl.getOffsetHeight());

            markerMap.put(markString, lbl);

            DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d, ''yy");

            FlexTable tooltip = new FlexTable();
            tooltip.setVisible(true);
            tooltip.setStyleName(CLASSNAME_MARKERTOOLTIP);
            tooltip.setBorderWidth(0);
            tooltip.setCellSpacing(0);
            tooltip.setCellPadding(0);

            tooltip.getRowFormatter().setStyleName(0, "top");
            tooltip.getCellFormatter().setStyleName(0, 0, "topLeft");
            tooltip.getCellFormatter().setStyleName(0, 1, "topMiddle");
            tooltip.getCellFormatter().setStyleName(0, 2, "topRight");

            tooltip.getRowFormatter().setStyleName(1, "middle");
            tooltip.getCellFormatter().setStyleName(1, 0, "middleLeft");
            tooltip.getCellFormatter().setStyleName(1, 1, "content");
            tooltip.getCellFormatter().setStyleName(1, 2, "middleRight");

            tooltip.getRowFormatter().setStyleName(2, "bottom");
            tooltip.getCellFormatter().setStyleName(2, 0, "bottomLeft");
            tooltip.getCellFormatter().setStyleName(2, 1, "bottomMiddle");
            tooltip.getCellFormatter().setStyleName(2, 2, "bottomRight");

            HTML content = new HTML(
                    "<span class=date>"+formatter.format(new Date(time))+"</span> <br/>"+
                    "<span class=text>"+description+"</span>"
            );

            tooltip.setWidget(1, 1, content);
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat

         * not the same as the browser locale
         */
        formatStr = formatMonthNames(date, formatStr);

        // Format uses the browser locale
        DateTimeFormat format = DateTimeFormat.getFormat(formatStr);

        String result = format.format(date);

        return result;
    }
View Full Code Here

Examples of com.google.gwt.i18n.client.DateTimeFormat

     *
     */
    public Date parseDate(String dateString, String formatString,
            boolean lenient) throws IllegalArgumentException {
        /* DateTimeFormat uses the browser's locale */
        DateTimeFormat format = DateTimeFormat.getFormat(formatString);

        /*
         * Parse month names separately when locale for the DateTimeService is
         * not the same as the browser locale
         */
        dateString = parseMonthName(dateString, formatString);

        Date date;

        if (lenient) {
            date = format.parse(dateString);
        } else {
            date = format.parseStrict(dateString);
        }

        // Some version of Firefox sets the timestamp to 0 if parsing fails.
        if (date != null && date.getTime() == 0) {
            throw new IllegalArgumentException("Parsing of '" + dateString
View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat

        assertEquals(expected, result);
    }

    /** Test getFormat(). */
    public void testGetFormat() {
        DateTimeFormat result = GwtDateUtils.getFormat("yyyy-MM-dd");
        assertNotNull(result);
        assertEquals("yyyy-MM-dd", result.getPattern());
    }
View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat

        assertEquals("yyyy-MM-dd", result.getPattern());
    }

    /** Test getDateFormat(). */
    public void testGetDateFormat() {
        DateTimeFormat result = GwtDateUtils.getDateFormat();
        assertNotNull(result);
        assertEquals(GwtDateUtils.DATE_FORMAT, result.getPattern());
    }
View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat

        assertEquals(GwtDateUtils.DATE_FORMAT, result.getPattern());
    }

    /** Test getTimeFormat(). */
    public void testGetTimeFormat() {
        DateTimeFormat result = GwtDateUtils.getTimeFormat();
        assertNotNull(result);
        assertEquals(GwtDateUtils.TIME_FORMAT, result.getPattern());
    }
View Full Code Here

Examples of com.google.gwt.i18n.shared.DateTimeFormat

        assertEquals(GwtDateUtils.TIME_FORMAT, result.getPattern());
    }

    /** Test getTimeOnlyFormat(). */
    public void testGetTimeOnlyFormat() {
        DateTimeFormat result = GwtDateUtils.getTimeOnlyFormat();
        assertNotNull(result);
        assertEquals(GwtDateUtils.TIME_ONLY_FORMAT, result.getPattern());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.