Package com.google.gwt.i18n.client

Examples of com.google.gwt.i18n.client.DateTimeFormat.format()


    trElement.appendChild(timeElement);
    timeElement.setClassName("msg-nick");
    timeElement.setAttribute("valign","bottom");
    timeElement.setAttribute("align", "right");
    DateTimeFormat timeFormat = DateTimeFormat.getMediumTimeFormat();
    String datetime = timeFormat.format(new java.util.Date());
    timeElement.setInnerHTML("<small>"+datetime+"</small>");
   
    Element messageElement = DOM.createSpan();
    messageElement.setInnerHTML(ChatTextFormatter.format(message == null ? "" : message).getHTML());
   
View Full Code Here


        formatStr = formatMonthNames(date, formatStr);

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

        String result = format.format(date);

        return result;
    }

    private String formatMonthNames(Date date, String formatStr) {
View Full Code Here

                canvas.moveTo(x, 0);
                canvas.lineTo(x, canvas.getHeight());

                // Add a label
                DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy");
                Label lbl = new Label(formatter.format(year));
                lbl.setStyleName(CLASSNAME_SCALELABEL);
                horizontalScalePanel.add(lbl);
                horizontalScalePanel.setWidgetPosition(lbl, (int)x+14+5, canvas.getHeight()-lbl.getOffsetHeight()+4);

                year = new Date(year.getYear()+1, 0, 1);
View Full Code Here

        @Override
        public String toString(){
            DateTimeFormat formatter = DateTimeFormat.getShortDateFormat();
            Date f = new Date(from);
            Date t = new Date(to);
            return "Datarange: "+formatter.format(f)+" - "+formatter.format(t)+", points="+points.size()+",max="+maximum.getValue()+", min="+minimum.getValue();
        }
    }

    /**
     * The loading timer to for executing background loading
View Full Code Here

        @Override
        public String toString(){
            DateTimeFormat formatter = DateTimeFormat.getShortDateFormat();
            Date f = new Date(from);
            Date t = new Date(to);
            return "Datarange: "+formatter.format(f)+" - "+formatter.format(t)+", points="+points.size()+",max="+maximum.getValue()+", min="+minimum.getValue();
        }
    }

    /**
     * The loading timer to for executing background loading
View Full Code Here

     */
    public void setFromDateTextField(Date date){
        intervalStartDate = date;

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d, y");
        dateFrom.setText(formatter.format(date));
    }

    /**
     * Set the ending date text field
     * @param date
View Full Code Here

     */
    public void setToDateTextField(Date date){
        intervalEndDate = date;

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d, y");
        dateTo.setText(formatter.format(date));
    }

    /**
     * The top bar height
     * @return
 
View Full Code Here

            dateTo.setStyleName(CLASSNAME_DATEFIELDEDIT);

            DateTimeFormat formatter = DateTimeFormat.getFormat("dd/MM/yyyy");

            dateTo.setText(formatter.format(intervalEndDate));
            dateTo.selectAll();

        } else if (event.getRelativeElement() == dateFrom.getElement()) {
            dateFrom.setStyleName(CLASSNAME_DATEFIELDEDIT);
View Full Code Here

        } else if (event.getRelativeElement() == dateFrom.getElement()) {
            dateFrom.setStyleName(CLASSNAME_DATEFIELDEDIT);

            DateTimeFormat formatter = DateTimeFormat.getFormat("dd/MM/yyyy");

            dateFrom.setText(formatter.format(intervalStartDate));
            dateFrom.selectAll();
        }
    }

    /**
 
View Full Code Here

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

            if (end.compareTo(getEndDate()) <= 0
                    && end.compareTo(intervalStartDate) > 0) {
                dateTo.setText(formatter.format(end));
                intervalEndDate = end;

                setBrowserRange(intervalStartDate, intervalEndDate);
                setDisplayRange(intervalStartDate, intervalEndDate, true);
            } else {
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.