Skip to content

Commit 152bc7a

Browse files
justingrantryzokuken
authored andcommitted
Documentation fixes for monthCode
* Add missing "M" prefix in a few docs code examples * Fix missing backticks * Minor wordsmithing to remove unneeded words
1 parent 0fa1e72 commit 152bc7a

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

docs/plaindate.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The above read-only properties allow accessing each component of a date individu
165165
The last month of every year has `month` equal to the `monthsInYear` property.
166166
`month` values start at 1, which is different from legacy `Date` where months are represented by zero-based indices (0 to 11).
167167
- `monthCode` is a calendar-specific string that identifies the month in a year-independent way.
168-
For common (non-leap) months, `monthCode` should be `M${month}`.
168+
For common (non-leap) months, `monthCode` should be `` `M${month}` ``.
169169
For uncommon (leap) months in lunisolar calendars like Hebrew or Chinese, the month code is the previous month's code with with an "L" suffix appended.
170170
Examples: `'M2'` => February; `'M8L'` => repeated 8th month in the Chinese calendar; `'M5L'` => Adar I in the Hebrew calendar.
171171
- `day` is a positive integer representing the day of the month.
@@ -180,13 +180,13 @@ Usage examples:
180180
date = Temporal.PlainDate.from('2006-08-24');
181181
date.year; // => 2006
182182
date.month; // => 8
183-
date.monthCode; // => "8"
183+
date.monthCode; // => "M8"
184184
date.day; // => 24
185185

186186
date = Temporal.PlainDate.from('2019-02-23[u-ca-hebrew]');
187187
date.year; // => 5779
188188
date.month; // => 6
189-
date.monthCode; // => "5L"
189+
date.monthCode; // => "M5L"
190190
date.day; // => 18
191191
```
192192
<!-- prettier-ignore-end -->

docs/plaindatetime.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Date unit details:
241241
The last month of every year has `month` equal to the `monthsInYear` property.
242242
`month` values start at 1, which is different from legacy `Date` where months are represented by zero-based indices (0 to 11).
243243
- `monthCode` is a calendar-specific string that identifies the month in a year-independent way.
244-
For common (non-leap) months, `monthCode` should be `M${month}`.
244+
For common (non-leap) months, `monthCode` should be `` `M${month}` ``.
245245
For uncommon (leap) months in lunisolar calendars like Hebrew or Chinese, the month code is the previous month's code with with an "L" suffix appended.
246246
Examples: `'M2'` => February; `'M8L'` => repeated 8th month in the Chinese calendar; `'M5L'` => Adar I in the Hebrew calendar.
247247
- `day` is a positive integer representing the day of the month.
@@ -266,7 +266,7 @@ Usage examples:
266266
dt = Temporal.PlainDateTime.from('1995-12-07T03:24:30.000003500');
267267
dt.year; // => 1995
268268
dt.month; // => 12
269-
dt.monthCode; // => "12"
269+
dt.monthCode; // => "M12"
270270
dt.day; // => 7
271271
dt.hour; // => 3
272272
dt.minute; // => 24
@@ -278,7 +278,7 @@ dt.nanosecond; // => 500
278278
dt = Temporal.PlainDate.from('2019-02-23T03:24:30.000003500[u-ca-hebrew]');
279279
dt.year; // => 5779
280280
dt.month; // => 6
281-
dt.monthCode; // => "5L"
281+
dt.monthCode; // => "M5L"
282282
dt.day; // => 18
283283
dt.hour; // => 3
284284
dt.minute; // => 24

docs/plainmonthday.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ md.month; // undefined (month property is not present in this type; use monthCod
133133
The above read-only properties allow accessing each component of the date individually.
134134

135135
- `monthCode` is a calendar-specific string that identifies the month in a year-independent way.
136-
For common (non-leap) months, `monthCode` should be `M${month}`.
136+
For common (non-leap) months, `monthCode` should be ` ` `M${month}` ` `.
137137
For uncommon (leap) months in lunisolar calendars like Hebrew or Chinese, the month code is the previous month's code with with an "L" suffix appended.
138138
Examples: `'M2'` => February; `'M8L'` => repeated 8th month in the Chinese calendar; `'M5L'` => Adar I in the Hebrew calendar.
139139
- `day` is a positive integer representing the day of the month.
@@ -145,14 +145,14 @@ Usage examples:
145145

146146
```javascript
147147
md = Temporal.PlainMonthDay.from('08-24');
148-
md.monthCode; // => "8"
148+
md.monthCode; // => "M8"
149149
md.day; // => 24
150-
md.month; // undefined (month property is not present in this type; use monthCode instead)
150+
md.month; // undefined (no `month` property; use `monthCode` instead)
151151

152152
md = Temporal.PlainMonthDay.from('2019-02-20[u-ca-hebrew]');
153-
md.monthCode; // => "5L"
153+
md.monthCode; // => "M5L"
154154
md.day; // => 15
155-
md.month; // undefined (month property is not present in this type; use monthCode instead)
155+
md.month; // undefined (no `month` property; use `monthCode` instead)
156156
```
157157

158158
### monthDay.**calendar** : object

docs/plainyearmonth.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ The above read-only properties allow accessing the year or month individually.
164164
The last month of every year has `month` equal to the `monthsInYear` property.
165165
`month` values start at 1, which is different from legacy `Date` where months are represented by zero-based indices (0 to 11).
166166
- `monthCode` is a calendar-specific string that identifies the month in a year-independent way.
167-
For common (non-leap) months, `monthCode` should be `M${month}`.
167+
For common (non-leap) months, `monthCode` should be `` `M${month}` ``.
168168
For uncommon (leap) months in lunisolar calendars like Hebrew or Chinese, the month code is the previous month's code with with an "L" suffix appended.
169169
Examples: `'M2'` => February; `'M8L'` => repeated 8th month in the Chinese calendar; `'M5L'` => Adar I in the Hebrew calendar.
170170

@@ -177,12 +177,12 @@ Usage examples:
177177
ym = Temporal.PlainYearMonth.from('2019-06');
178178
ym.year; // => 2019
179179
ym.month; // => 6
180-
ym.monthCode; // => "6"
180+
ym.monthCode; // => "M6"
181181

182182
ym = Temporal.PlainYearMonth.from('2019-02-23[u-ca-hebrew]');
183183
ym.year; // => 5779
184184
ym.month; // => 6
185-
ym.monthCode; // => "5L"
185+
ym.monthCode; // => "M5L"
186186
ym.day; // => 18
187187
```
188188

docs/zoneddatetime.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Date unit details:
301301
The last month of every year has `month` equal to the `monthsInYear` property.
302302
`month` values start at 1, which is different from legacy `Date` where months are represented by zero-based indices (0 to 11).
303303
- `monthCode` is a calendar-specific string that identifies the month in a year-independent way.
304-
For common (non-leap) months, `monthCode` should be `M${month}`.
304+
For common (non-leap) months, `monthCode` should be `` `M${month}` ``.
305305
For uncommon (leap) months in lunisolar calendars like Hebrew or Chinese, the month code is the previous month's code with with an "L" suffix appended.
306306
Examples: `'M2'` => February; `'M8L'` => repeated 8th month in the Chinese calendar; `'M5L'` => Adar I in the Hebrew calendar.
307307
- `day` is a positive integer representing the day of the month.
@@ -326,7 +326,7 @@ Usage examples:
326326
dt = Temporal.ZonedDateTime.from('1995-12-07T03:24:30.000003500[Europe/Rome]');
327327
dt.year; // => 1995
328328
dt.month; // => 12
329-
dt.monthCode; // => "12"
329+
dt.monthCode; // => "M12"
330330
dt.day; // => 7
331331
dt.hour; // => 3
332332
dt.minute; // => 24
@@ -338,7 +338,7 @@ dt.nanosecond; // => 500
338338
dt = Temporal.ZonedDateTime.from('2019-02-23T03:24:30.000003500[Europe/Rome][u-ca-hebrew]');
339339
dt.year; // => 5779
340340
dt.month; // => 6
341-
dt.monthCode; // => "5L"
341+
dt.monthCode; // => "M5L"
342342
dt.day; // => 18
343343
dt.hour; // => 3
344344
dt.minute; // => 24

0 commit comments

Comments
 (0)