mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-21959 fix DateIntervalFormat general usage example
This commit is contained in:
parent
d3a753a0d4
commit
5de6ee0c61
1 changed files with 5 additions and 4 deletions
|
@ -206,11 +206,12 @@ import com.ibm.icu.util.UResourceBundle;
|
|||
* // and parses into
|
||||
* DateInterval dtInterval = new DateInterval(1000*3600*24L, 1000*3600*24*2L);
|
||||
* DateIntervalFormat dtIntervalFmt = DateIntervalFormat.getInstance(
|
||||
* YEAR_MONTH_DAY, Locale("en", "GB", ""));
|
||||
* StringBuffer str = new StringBuffer("");
|
||||
* FieldPosition pos = new FieldPosition(0);
|
||||
* DateFormat.YEAR_MONTH_DAY, new Locale("en", "GB", ""));
|
||||
* StringBuffer result = new StringBuffer("");
|
||||
* FieldPosition pos = new FieldPosition(-1);
|
||||
* // formatting
|
||||
* dtIntervalFmt.format(dtInterval, dateIntervalString, pos);
|
||||
* dtIntervalFmt.format(dtInterval, result, pos);
|
||||
* assertEquals("interval", "1–2 January 1970", result.toString());
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue