/** * Returns {@code true} if the month is before year in the date formatter in current locale. */ protected boolean isMonthBeforeYear() { String monthAndYearPattern = getMonthAndYearFormatter().getPattern(); for (int i = 0; i < monthAndYearPattern.length(); ++i) { switch (monthAndYearPattern.charAt(i)) { case 'y': return false; case 'M': case 'L': return true; } } return true; }
/** * Simple check, if time format has hours it has time. * @param formatter * @return */ private boolean hasTime( DateTimeFormat formatter ) { return formatter.getPattern().contains( "h" ) || formatter.getPattern().contains( "H" ) || formatter.getPattern().contains( "k" ) || formatter.getPattern().contains( "K" ); }
/** * Returns {@code true} if the month is before year in the date formatter in current locale. */ protected boolean isMonthBeforeYear() { String monthAndYearPattern = getMonthAndYearFormatter().getPattern(); for (int i = 0; i < monthAndYearPattern.length(); ++i) { switch (monthAndYearPattern.charAt(i)) { case 'y': return false; case 'M': case 'L': return true; } } return true; }
/** * Returns {@code true} if the month is before year in the date formatter in current locale. */ protected boolean isMonthBeforeYear() { String monthAndYearPattern = getMonthAndYearFormatter().getPattern(); for (int i = 0; i < monthAndYearPattern.length(); ++i) { switch (monthAndYearPattern.charAt(i)) { case 'y': return false; case 'M': case 'L': return true; } } return true; }
private void fireColumnFilterChangedEvent(Date primaryDate, Date secondaryDate) { fireColumnFilterChanged(new DateColumnFilterInfo(getColumn(), dateTimeFormat.getPattern(), primaryDate, secondaryDate, operator)); }
@Override public void setDateFormat( final DateTimeFormat dateFormat ) { datebox.setFormat( DatePickerFormatUtilities.convertToBS3DateFormat( dateFormat.getPattern() ) ); Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand() { @Override public void execute() { datebox.reload(); } } ); }
public DateBoxBase() { this.box = new TextBox(); this.language = LocaleUtil.getLanguage(); setElement(box.getElement()); setFormat(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_SHORT).getPattern().toLowerCase()); setWeekStart(LocaleInfo.getCurrentLocale().getDateTimeFormatInfo().firstDayOfTheWeek()); setValue(new Date()); }
String error = null; if (getMessages().getInvalidText() != null) { error = Format.substitute(getMessages().getInvalidText(), value, format.getPattern().toUpperCase()); } else { error = GXT.MESSAGES.dateField_invalidText(value, format.getPattern().toUpperCase());
public MDateBox(InputAppearance appearance) { super(appearance, new DateValueBoxBase(new DateRenderer(), new DateParser())); format = DEFAULT_FORMAT; setPlaceHolder(DEFAULT_FORMAT.getPattern());
public MDateBox(InputAppearance appearance) { super(appearance, new DateValueBoxBase(new DateRenderer(), new DateParser())); format = DEFAULT_FORMAT; setPlaceHolder(DEFAULT_FORMAT.getPattern());