Examples of DateFormatter


Examples of Control.DateFormatter

    Style headerStyle;

    try {

      String timeStarted = getDisplayedDate(dateChatStarted, true, false);
      DateFormatter formattedDate = new DateFormatter(dateChatStarted);

      styleDoc.insertString(styleDoc.getLength(), "Unterhaltung mit "
          + messages.get(0).getChatPartner().getDisplayedName() +" am "
          + formattedDate.getDay() + ". " + formattedDate.getMonthString()
          + " " + formattedDate.getYear() + " um "
          + timeStarted +" Uhr gestartet...", startInformationStyle);
      styleDoc.insertString(styleDoc.getLength(), "\n\n", biggerSpaceStyle);
      styleDoc.insertString(styleDoc.getLength(), "\n", littleSpaceStyle);

      for(Message message : messages){
View Full Code Here

Examples of br.com.visualmidia.tools.comp4swt.DateFormatter

        birthdateLabel.setLayoutData(data);
    }

    private void createBirthdateText() {
        birthdateText = new FormattedText(mainComposite, SWT.SINGLE | SWT.BORDER);
        DateFormatter dateFormatter = new DateFormatter("dd/MM/yyyy");
        birthdateText.setFormatter(dateFormatter);
        birthdateText.getControl().addFocusListener(new RequiredWhenLostFocus(birthdateText, RequiredWhenLostFocus.ERROR_REQUIRED_BIRTHDATE, screenMessageLabel));
        birthdateText.getControl().setText("");
       
        birthdateText.getControl().addFocusListener(new FocusListener(){
      public void focusLost(FocusEvent arg0) {
        if (birthdateText.getControl().getText().contains(" ")) {
          DateFormatter dateFormatter = new DateFormatter("dd/MM/yyyy");
              birthdateText.setFormatter(dateFormatter);
          birthdateText.getControl().setText("");
          screenMessageLabel.setText("Data de nascimento inv�lida. ");
        }
      }
View Full Code Here

Examples of com.codeforces.graygoose.util.DateFormatter

    }

    @Override
    public void action() {
        put("sites", siteDao.findAll());
        put("dateFormatter", new DateFormatter());
    }
View Full Code Here

Examples of com.xeiam.xchart.internal.chartpart.DateFormatter

  @Test
  public void testDateFormatting() {

    StyleManager styleManager = new StyleManager();
    DateFormatter dateFormatter = new DateFormatter(styleManager);

    TimeZone timeZone = TimeZone.getTimeZone("UTC");

    styleManager.setLocale(locale);
    styleManager.setTimezone(timeZone);

    // ms
    double value = 1358108105531L;
    double min = 1358108105100L;
    double max = 1358108105900L;
    double span = Math.abs(max - min); // in data space
    long gridStepHint = (long) (span / 1000 * 74);
    long timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    String stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("05.531"));

    // sec
    value = 1358108105000L;
    min = 1358108101000L;
    max = 1358108109000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("05.000"));

    // min
    value = 1358111750000L;
    min = 1358111690000L;
    max = 1358111870000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("15:50"));

    // hour
    value = 1358111870000L;
    min = 1358101070000L;
    max = 1358115470000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("21:17"));

    // day
    value = 1358112317000L;
    min = 1357939517000L;
    max = 1358285117000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("21:25"));

    // week
    value = 1358112317000L;
    min = 1357075517000L;
    max = 1359149117000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("01-13"));

    // month
    value = 1358112838000L;
    min = 1354397638000L;
    max = 1361223238000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("01-13"));

    // year
    value = 1358113402000L;
    min = 1263419002000L;
    max = 1421185402000L;
    span = Math.abs(max - min); // in data space
    gridStepHint = (long) (span / 1000 * 74);
    timeUnit = dateFormatter.getTimeUnit(gridStepHint);
    stringValue = dateFormatter.formatDate(value, timeUnit);
    assertThat(stringValue, equalTo("2013-01"));

  }
View Full Code Here

Examples of de.willuhn.jameica.gui.formatter.DateFormatter

      }
    });
    addColumn(i18n.tr("Saldo"),"saldo",null,false,Column.ALIGN_RIGHT);
    addSaldoAvailable(konten);
    // BUGZILLA 108 http://www.willuhn.de/bugzilla/show_bug.cgi?id=108
    addColumn(i18n.tr("Saldo aktualisiert am"),"saldo_datum", new DateFormatter(HBCI.LONGDATEFORMAT));
    setFormatter(new TableFormatter()
    {
      public void format(TableItem item)
      {
        Konto k = (Konto) item.getData();
View Full Code Here

Examples of javax.swing.text.DateFormatter

    dateField.setFormatterFactory(new JFormattedTextField.AbstractFormatterFactory()
    {
      public JFormattedTextField.AbstractFormatter getFormatter(final JFormattedTextField tf)
      {
        return new DateFormatter(timeFormat) {
          // allow to clear the field
          public Object stringToValue(final String text) throws ParseException
          {
            return "".equals(text) ? null : super.stringToValue(text);
          }
View Full Code Here

Examples of org.eclipse.birt.core.format.DateFormatter

            } else if (val.startsWith("ahh")) {
                return "Long Time";
            } else if (!val.startsWith("ahh") && val.indexOf("ahh") >= 0) {
                return "General Date";
            }
            return new DateFormatter(val).getPattern();
        } else if (val == null && data instanceof Time) {
            return "Long Time";
        } else if (val == null && data instanceof java.sql.Date) {
            return "yyyy-M-d";
        } else if (val == null && data instanceof java.util.Date) {
View Full Code Here

Examples of org.eurekastreams.commons.formatting.DateFormatter

    insertActionSeparator(followersPanel);

    followersPanel.add(new InlineLabel("Added: "));

    DateFormatter dateFormatter = new DateFormatter(new Date());
    InlineLabel dateAdded = new InlineLabel(dateFormatter.timeAgo(group.getDateAdded(), true));
    dateAdded.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData());
    followersPanel.add(dateAdded);

    infoPanel.add(followersPanel);
      }
View Full Code Here

Examples of org.opencustomer.framework.db.util.engine.configuration.DateFormatter

            Node attributeNode = attributes.item(i);
            if(attributeNode.getNodeType() == Node.ATTRIBUTE_NODE) {
                String name = attributeNode.getNodeName();
                if("type".equals(name)) {
                    if("date".equals(attributeNode.getNodeValue())) {
                        format = new DateFormatter(attributes.getNamedItem("formatKey").getNodeValue());
                    } else if("enum".equals(attributeNode.getNodeValue())) {
                        try {
                            EnumFormatter enumFormat = new EnumFormatter((Class<? extends Enum>)Class.forName(attributes.getNamedItem("class").getNodeValue()));
                            NodeList nodes = node.getChildNodes();
                            for(int j=0; j<nodes.getLength(); j++) {
View Full Code Here

Examples of org.openstreetmap.osmosis.core.time.DateFormatter

  /**
   * {@inheritDoc}
   */
  @Override
  public String formatTimestamp(Date timestamp) {
    DateFormatter dateFormatter;
   
    dateFormatter = dateFormatterStore.get();
    if (dateFormatter == null) {
      dateFormatter = new DateFormatter();
      dateFormatterStore.set(dateFormatter);
    }
   
    return dateFormatter.format(timestamp);
  }
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.