8281103: Give example for Locale that is English and follows the ISO standards

Reviewed-by: rriggs, lancea, naoto
This commit is contained in:
Justin Lu 2023-05-10 23:57:48 +00:00
parent 958d4a7505
commit 4795c395e9

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -294,6 +294,14 @@ public final class WeekFields implements Serializable {
* those extensions. If both "fw" and "rg" are specified, the value from
* the "fw" extension supersedes the implicit one from the "rg" extension.
*
* <p>For example, users who are interested in using an English locale,
* but want the first day of the week that corresponds with the ISO-8601
* standard can call
* {@snippet lang=java :
* Locale enIsoLoc = Locale.forLanguageTag("en-u-fw-mon");
* WeekFields.of(enIsoLoc).getFirstDayOfWeek(); // returns MONDAY
* }
*
* @param locale the locale to use, not null
* @return the week-definition, not null
*/