Skip to content

Commit bcad61d

Browse files
committed
Merge branch 'master' of https://github.com/jmrozanec/cron-utils
2 parents e3e0574 + b080eba commit bcad61d

19 files changed

Lines changed: 88 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
@@ -14,6 +14,7 @@
1414
package com.cronutils.descriptor;
1515

1616
import com.cronutils.model.field.expression.Every;
17+
import java.text.MessageFormat;
1718
import java.time.DayOfWeek;
1819
import java.time.Month;
1920
import java.time.format.TextStyle;
@@ -83,7 +84,14 @@ public static DescriptionStrategy daysOfMonthInstance(final ResourceBundle bundl
8384
return String
8485
.format("%s %s %s ", bundle.getString("the_nearest_weekday_to_the"), on.getTime().getValue(), bundle.getString("of_the_month"));
8586
case L:
86-
return bundle.getString("last_day_of_month");
87+
Integer daysBefore = on.getNth().getValue();
88+
if (daysBefore > 1) {
89+
return MessageFormat.format(bundle.getString("days_before_last_day_of_month"), daysBefore);
90+
} else if (daysBefore == 1){
91+
return bundle.getString("day_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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ 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+
day_before_last_day_of_month=one day before the last day of the month
25+
days_before_last_day_of_month={0} days before the last day of the month
2426

2527
pattern_every_seconds = {0} {1}
2628
every_one=every

src/main/resources/CronUtilsI18N_de.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ 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+
day_before_last_day_of_month=einen Tag vor dem letzten Tag des Monats
25+
days_before_last_day_of_month={0} Tage vor dem letzten Tag des Monats
2526

2627
pattern_every_seconds = {0} {1}
2728
every_one=jede

src/main/resources/CronUtilsI18N_el.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ 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+
day_before_last_day_of_month=\u03BC\u03AF\u03B1 \u03B7\u03BC\u03AD\u03C1\u03B1 \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
25+
days_before_last_day_of_month={0} \u03B7\u03BC\u03AD\u03C1\u03B5\u03C2 \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: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
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+
day_before_last_day_of_month=one day before the last day of the month
26+
days_before_last_day_of_month={0} days before the last day of the month

src/main/resources/CronUtilsI18N_es.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ 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+
day_before_last_day_of_month=un día antes del último día del mes
25+
days_before_last_day_of_month={0} días antes del último día del mes

src/main/resources/CronUtilsI18N_fr.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ days=jours
2121
months=les mois
2222
years=les ann\u00e9es
2323
last_weekday_of_month=derni\u00e8re semaine du mois
24+
day_before_last_day_of_month=un jour avant le dernier jour du mois
25+
days_before_last_day_of_month={0} jours avant le dernier jour du mois

src/main/resources/CronUtilsI18N_id.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ 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+
day_before_last_day_of_month=satu hari sebelum hari terakhir bulan itu
25+
days_before_last_day_of_month={0} hari sebelum hari terakhir setiap bulan

src/main/resources/CronUtilsI18N_it.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ 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+
day_before_last_day_of_month=un giorno prima dell'ultimo giorno del mese
25+
days_before_last_day_of_month={0} giorni prima dell'ultimo giorno del mese

src/main/resources/CronUtilsI18N_ko.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ 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+
day_before_last_day_of_month=\uB9E4\uC6D4 \uB9D0\uC77C \uD558\uB8E8 \uC804
25+
days_before_last_day_of_month=\uB9E4\uC6D4 \uB9D0\uC77C {0} \uC77C \uC804

0 commit comments

Comments
 (0)