コード例 #1
0
ファイル: CmsDateBox.java プロジェクト: rinnes/opencms-core
  /**
   * 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
ファイル: CmsDateBox.java プロジェクト: rinnes/opencms-core
  /** @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;
  }