Skip to content

Commit 64cfd63

Browse files
committed
Fix Issue #308
1 parent 7937ce6 commit 64cfd63

19 files changed

Lines changed: 71 additions & 41 deletions

src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@ public static DescriptionStrategy daysOfMonthInstance(final ResourceBundle bundl
8383
return String
8484
.format("%s %s %s ", bundle.getString("the_nearest_weekday_to_the"), on.getTime().getValue(), bundle.getString("of_the_month"));
8585
case L:
86-
return bundle.getString("last_day_of_month");
86+
Integer daysBefore = on.getNth().getValue();
87+
if (daysBefore > 0) {
88+
String daysRep =
89+
daysBefore == 1 ? bundle.getString("day") : bundle.getString("days");
90+
return String.format("%d %s %s", daysBefore, daysRep,
91+
bundle.getString("before_last_day_of_month"));
92+
} else {
93+
return bundle.getString("last_day_of_month");
94+
}
8795
case LW:
8896
return bundle.getString("last_weekday_of_month");
8997
default:

src/main/resources/CronUtilsI18N.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ last=last
2121
the_nearest_weekday_to_the=the nearest weekday to the
2222
last_day_of_month=last day of month
2323
last_weekday_of_month=last weekday of month
24+
before_last_day_of_month=before the last day of the month
2425

2526
pattern_every_seconds = {0} {1}
2627
every_one=every

src/main/resources/CronUtilsI18N_de.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ last=letzten
2121
the_nearest_weekday_to_the=am n\ufffdchsten Werktag nach dem
2222
last_day_of_month=letzten Tag des Monats
2323
last_weekday_of_month=letzten Werktag des Monats
24-
24+
before_last_day_of_month=vor dem letzten Tag des Monats
2525

2626
pattern_every_seconds = {0} {1}
2727
every_one=jede

src/main/resources/CronUtilsI18N_el.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ last=\u03C4\u03B5\u03BB\u03B1\u03C5\u03C4\u03B1\u03AF\u03BF
2121
the_nearest_weekday_to_the=\u03B7 \u03BA\u03BF\u03BD\u03C4\u03B9\u03BD\u03CC\u03C4\u03B5\u03C1\u03B7 \u03B5\u03C1\u03B3\u03AC\u03C3\u03B9\u03BC\u03B7 \u03C3\u03C4\u03BF
2222
last_day_of_month=\u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03BC\u03AD\u03C1\u03B1 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
2323
last_weekday_of_month=\u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B5\u03C1\u03B3\u03AC\u03C3\u03B9\u03BC\u03B7 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
24+
before_last_day_of_month=\u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B7\u03BC\u03AD\u03C1\u03B1 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
between_x_and_y=between {0} and {1}
2-
every=every
3-
and=and
4-
at=at
5-
day=day
6-
days=days
7-
hour=hour
8-
hours=hours
9-
minute=minute
10-
minutes=minutes
11-
second=second
12-
seconds=seconds
13-
month=month
14-
months=months
15-
year=year
16-
years=years
17-
between=between
18-
of_every_month=of every month
19-
of_every_hour=of every hour
20-
of_the_month=of the month
21-
last=last
22-
the_nearest_weekday_to_the=the nearest weekday to the
23-
last_day_of_month=last day of month
24-
last_weekday_of_month=last weekday of month
1+
between_x_and_y=between {0} and {1}
2+
every=every
3+
and=and
4+
at=at
5+
day=day
6+
days=days
7+
hour=hour
8+
hours=hours
9+
minute=minute
10+
minutes=minutes
11+
second=second
12+
seconds=seconds
13+
month=month
14+
months=months
15+
year=year
16+
years=years
17+
between=between
18+
of_every_month=of every month
19+
of_every_hour=of every hour
20+
of_the_month=of the month
21+
last=last
22+
the_nearest_weekday_to_the=the nearest weekday to the
23+
last_day_of_month=last day of month
24+
last_weekday_of_month=last weekday of month
25+
before_last_day_of_month=before the last day of the month

src/main/resources/CronUtilsI18N_es.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ last=ultimo
2121
the_nearest_weekday_to_the=dia de semana mas cercano a
2222
last_day_of_month=ultimo dia del mes
2323
last_weekday_of_month=ultimo dia de semana del mes
24+
before_last_day_of_month=antes del \u00FAltimo d\u00EDa del mes

src/main/resources/CronUtilsI18N_fr.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ days=jours
2121
months=les mois
2222
years=les ann\u00e9es
2323
last_weekday_of_month=derni\u00e8re semaine du mois
24+
before_last_day_of_month=avant le dernier jour du mois

src/main/resources/CronUtilsI18N_id.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ last=terakhir
2121
the_nearest_weekday_to_the=hari kerja terdekat ke
2222
last_day_of_month=hari terakhir di bulan
2323
last_weekday_of_month=hari kerja terakhir di bulan
24+
before_last_day_of_month=sebelum hari terakhir setiap bulan

src/main/resources/CronUtilsI18N_it.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ of_the_month=del mese
2020
last=ultimo
2121
the_nearest_weekday_to_the=il giorno della settimana più vicino a
2222
last_day_of_month=ultimo giorno del mese
23-
last_weekday_of_month=ultimo giorno della settimana nel mese
23+
last_weekday_of_month=ultimo giorno della settimana nel mese
24+
before_last_day_of_month=prima dell'ultimo giorno del mese

src/main/resources/CronUtilsI18N_ko.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ last=\uB9C8\uC9C0\uB9C9
2121
the_nearest_weekday_to_the=\uAC00\uC7A5 \uAC00\uAE4C\uC6B4 \uD3C9\uC77C
2222
last_day_of_month=\uB9D0\uC77C
2323
last_weekday_of_month=\uB9C8\uC9C0\uB9C9 \uC8FC
24+
before_last_day_of_month=\uB9E4\uC6D4 \uB9D0\uC77C \uC774\uC804

0 commit comments

Comments
 (0)