Skip to content

Commit 4795c39

Browse files
author
Justin Lu
committed
8281103: Give example for Locale that is English and follows the ISO standards
Reviewed-by: rriggs, lancea, naoto
1 parent 958d4a7 commit 4795c39

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/java.base/share/classes/java/time/temporal/WeekFields.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -294,6 +294,14 @@ public final class WeekFields implements Serializable {
294294
* those extensions. If both "fw" and "rg" are specified, the value from
295295
* the "fw" extension supersedes the implicit one from the "rg" extension.
296296
*
297+
* <p>For example, users who are interested in using an English locale,
298+
* but want the first day of the week that corresponds with the ISO-8601
299+
* standard can call
300+
* {@snippet lang=java :
301+
* Locale enIsoLoc = Locale.forLanguageTag("en-u-fw-mon");
302+
* WeekFields.of(enIsoLoc).getFirstDayOfWeek(); // returns MONDAY
303+
* }
304+
*
297305
* @param locale the locale to use, not null
298306
* @return the week-definition, not null
299307
*/

0 commit comments

Comments
 (0)