Skip to content

Commit

Permalink
Make the code understandable without comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sigee committed Dec 26, 2024
1 parent 5d810b2 commit e4b425e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void testCalendarValidatorMethods() {
// Don't rely on specific German format - it varies between JVMs
DateFormat df = new SimpleDateFormat(germanPattern, locale);
Calendar cal = Calendar.getInstance(Locale.US);
cal.set(2005, 11, 31); // month is 0-based
cal.set(2005, Calendar.DECEMBER, 31);
final String germanVal = df.format(cal.getTime());
final String localeVal = "31.12.2005";
final String defaultVal = "12/31/05";
Expand Down Expand Up @@ -241,12 +241,12 @@ public void testDateTimeStyle() {
// Formats vary between JVMs, so create the test strings using the current JVM
final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
final Calendar cal = Calendar.getInstance();
cal.set(2005, 11, 31, 14, 23); // month is 0-based
cal.set(2005, Calendar.DECEMBER, 31, 14, 23);
final String val = df.format(cal.getTime());

final DateFormat usdf = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US);
final Calendar uscal = Calendar.getInstance(Locale.US);
uscal.set(2005, 11, 31, 14, 23); // month is 0-based
uscal.set(2005, Calendar.DECEMBER, 31, 14, 23);
final String usval = usdf.format(uscal.getTime());

final AbstractCalendarValidator dateTimeValidator = new AbstractCalendarValidator(true, DateFormat.SHORT, DateFormat.SHORT) {
Expand Down

0 comments on commit e4b425e

Please sign in to comment.