示例#1
0
  /**
   * Checks if the String in the date box input field is a valid date format.
   *
   * <p>
   *
   * @return <code>true</code> if the String in the date box input field is a valid date format
   */
  public boolean isValideDateBox() {

    try {
      CmsDateConverter.toDate(m_box.getText());
      return true;
    } catch (Exception e) {
      return false;
    }
  }
示例#2
0
  /** @see com.google.gwt.user.client.ui.HasValue#getValue() */
  public Date getValue() {

    Date date = null;
    if (isEnabled()) {
      try {
        date = CmsDateConverter.toDate(m_box.getText());
        setErrorMessage(null);
      } catch (Exception e) {
        setErrorMessage(Messages.get().key(Messages.ERR_DATEBOX_INVALID_DATE_FORMAT_0));
      }
    }
    return date;
  }