Last Friday of each month: Difference between revisions
Content added Content deleted
(→{{header|Java}}: fix bug: getShortMonths returns 13 elements, the last one may be an empty string) |
|||
Line 394: | Line 394: | ||
for (String mon : new DateFormatSymbols(Locale.US).getShortMonths()) { |
for (String mon : new DateFormatSymbols(Locale.US).getShortMonths()) { |
||
if (!mon.isEmpty()) { |
|||
⚫ | |||
⚫ | |||
int |
int daysToRollBack = (c.get(Calendar.DAY_OF_WEEK) + 1) % 7; |
||
⚫ | |||
⚫ | |||
c.set(Calendar.DAY_OF_MONTH, day); |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
c.set(year, c.get(Calendar.MONTH) + 1, 1); |
c.set(year, c.get(Calendar.MONTH) + 1, 1); |
||
⚫ | |||
} |
} |
||
} |
} |