Skip to content

Commit

Permalink
Removes week_year date format
Browse files Browse the repository at this point in the history
week_year is replaced by weekyear. This is a single field YYYY date
format.

relates elastic#60707
  • Loading branch information
pgomulka committed Oct 7, 2020
1 parent 47eb590 commit ad6eb70
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions server/src/main/java/org/elasticsearch/common/joda/Joda.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ public static JodaDateFormatter forPattern(String input) {
formatter = ISODateTimeFormat.weekDateTime();
} else if ("weekDateTimeNoMillis".equals(input) || "week_date_time_no_millis".equals(input)) {
formatter = ISODateTimeFormat.weekDateTimeNoMillis();
} else if ("week_year".equals(input)) {
deprecationLogger.getOrCompute()
.deprecate("week_year_format_name", "Format name \"week_year\" is deprecated and will be removed in a future version. " +
"Use \"weekyear\" format instead");
formatter = ISODateTimeFormat.weekyear();
} else if ("weekyear".equals(input) ) {
formatter = ISODateTimeFormat.weekyear();
} else if ("weekyearWeek".equals(input) || "weekyear_week".equals(input)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1170,10 +1170,6 @@ public class DateFormatters {
/*
* Returns a formatter for a four digit weekyear. (YYYY)
*/
private static final DateFormatter WEEK_YEAR = new JavaDateFormatter("week_year",
new DateTimeFormatterBuilder().appendValue(WEEK_FIELDS_ROOT.weekBasedYear()).toFormatter(Locale.ROOT)
.withResolverStyle(ResolverStyle.STRICT));

private static final DateFormatter WEEKYEAR = new JavaDateFormatter("weekyear",
new DateTimeFormatterBuilder().appendValue(WEEK_FIELDS_ROOT.weekBasedYear()).toFormatter(Locale.ROOT)
.withResolverStyle(ResolverStyle.STRICT));
Expand Down Expand Up @@ -1723,11 +1719,6 @@ public class DateFormatters {
return WEEK_DATE_TIME;
} else if (FormatNames.WEEK_DATE_TIME_NO_MILLIS.matches(input)) {
return WEEK_DATE_TIME_NO_MILLIS;
} else if (FormatNames.WEEK_YEAR.matches(input)) {
deprecationLogger.getOrCompute()
.deprecate("week_year_format_name", "Format name \"week_year\" is deprecated and will be removed in a future version. " +
"Use \"weekyear\" format instead");
return WEEK_YEAR;
} else if (FormatNames.WEEKYEAR.matches(input)) {
return WEEKYEAR;
} else if (FormatNames.WEEK_YEAR_WEEK.matches(input)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public enum FormatNames {
WEEK_DATE("week_date"),
WEEK_DATE_TIME("week_date_time"),
WEEK_DATE_TIME_NO_MILLIS("week_date_time_no_millis"),
WEEK_YEAR("week_year"),
WEEKYEAR("weekyear"),
WEEK_YEAR_WEEK("weekyear_week"),
WEEKYEAR_WEEK_DAY("weekyear_week_day"),
Expand Down

0 comments on commit ad6eb70

Please sign in to comment.