Skip to content

Commit

Permalink
Polish Javadoc for @⁠DateTimeFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Oct 21, 2024
1 parent bbbb7c3 commit d48f388
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,6 +25,9 @@
/**
* Declares that a field or method parameter should be formatted as a date or time.
*
* <p>Formatting applies to parsing a date/time object from a string as well as printing a
* date/time object to a string.
*
* <p>Supports formatting by style pattern, ISO date time pattern, or custom format pattern string.
* Can be applied to {@link java.util.Date}, {@link java.util.Calendar}, {@link Long} (for
* millisecond timestamps) as well as JSR-310 {@code java.time} value types.
Expand All @@ -33,7 +36,8 @@
* The first character of the code is the date style, and the second character is the time style.
* Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full.
* The date or time may be omitted by specifying the style character '-' &mdash; for example,
* 'M-' specifies a medium format for the date with no time.
* 'M-' specifies a medium format for the date with no time. The supported style pattern codes
* correlate to the enum constants defined in {@link java.time.format.FormatStyle}.
*
* <p>For ISO-based formatting, set the {@link #iso} attribute to the desired {@link ISO} format,
* such as {@link ISO#DATE}.
Expand Down Expand Up @@ -65,6 +69,8 @@
* @author Juergen Hoeller
* @author Sam Brannen
* @since 3.0
* @see java.text.DateFormat
* @see java.text.SimpleDateFormat
* @see java.time.format.DateTimeFormatter
*/
@Documented
Expand All @@ -77,6 +83,8 @@
* <p>Defaults to 'SS' for short date, short time. Set this attribute when you
* wish to format your field or method parameter in accordance with a common
* style other than the default style.
* <p>See the {@linkplain DateTimeFormat class-level documentation} for further
* details.
* @see #fallbackPatterns
*/
String style() default "SS";
Expand Down

0 comments on commit d48f388

Please sign in to comment.